Buttons provide a clickable element, which can be used in forms, or anywhere that needs simple, standard button functionality. They may display text, icons, or both. Buttons can be styled with several attributes to look a specific way.
This property lets you specify how wide the button should be. By default, buttons have display: inline-block, but setting this property will change the button to a full-width element with display: block.
This property lets you specify the shape of the button. By default, buttons are rectangular with a small border radius, but setting this to "round" will change the button to a rounded element.
This property determines the background and border color of the button. By default, buttons have a solid background unless the button is inside of a toolbar, in which case it has a transparent background.
Buttons are built to be accessible, but may need some adjustments depending on their content. The button component renders a native button element which allows it to take advantage of the functionality that a native button provides.
There are many cases where a button's text content may overflow the container. It is recommended to wrap the text inside of the button when this happens so that all of the text can still be read. The button component will automatically adjust its height to accommodate the extra lines of text.
The button text does not automatically wrap to the next line when the text is too long to fit. In order to make the text wrap, the ion-text-wrap class can be added, which will set the white-space property to "normal". This will become the default in a future major release.
info
The max-width style is set on the button below for demo purposes only. Text wrapping will work with a dynamic button width.
<ion-button>Default</ion-button> <ion-buttonclass="ion-text-wrap"style="max-width:400px" >This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends</ion-button >
The color to use from your application's color palette. Default options are: "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", and "dark". For more information on colors, see theming.
This attribute instructs browsers to download a URL instead of navigating to it, so the user will be prompted to save it as a local file. If the attribute has a value, it is used as the pre-filled file name in the Save prompt (the user can still change the file name if they want).
Set to "clear" for a transparent button that resembles a flat button, to "outline" for a transparent button with a border, or to "solid" for a button with a filled background. The default fill is "solid" except inside of a toolbar, where the default is "clear".
Set to "small" for a button with less height and padding, to "default" for a button with the default height and padding, or to "large" for a button with more height and padding. By default the size is unset, unless the button is inside of an item, where the size is "small" by default. Set the size to "default" inside of an item to make it a standard size button.