The Button component can be used to trigger an action, such as submitting a form, opening a modal, and more.
import { Button } from '@frontile/buttons';
The custom
appearance is available for the cases where you might want to fully customize the appearance of the button.
The default styles are mainly structural. Intent colors are applied as color
.
Sometimes a button element is not ideal for a given case, but the same styles are still desired.
Frontile provides the option to disable rendering the button
element, but instead it yields back an object with
the class names it would use.
You can compose appearance with intents and more to create the button that best fits your needs.
You can also use TailwindCSS classes to customize even further.
Here is another example using TailwindCSS classes with the custom
appearance.
Note that here we used the HTML attribute class
, instead of the argument @class
.
Using the class attribute will just append the class names passed in, while the
argument @class
will override and merge TailwindCSS class names.
Element: HTMLButtonElement
Name | Type | Default | Description |
---|---|---|---|
appearance
|
enum
|
'default'
|
The button appearance |
class
|
string
|
- | Custom class name, it will override the default ones using Tailwind Merge library. |
intent
|
enum
|
- | The intent of the button |
isInGroup
|
boolean
|
- | If button is part of a group. Most of the time, this is automatically set when using the ButtonGroup component. |
isRenderless
|
boolean
|
- | Disable rendering the button element. It yields an object with classNames instead. |
size
|
enum
|
- | The size of the button |
type
|
enum
|
'button'
|
The HTML type of the button |
Name | Type | Default | Description |
---|---|---|---|
default
*
|
Array
|
- |