Button
Buttons allow users to take actions, and make choices, with a single tap. Buttons communicate actions that users can take. They are typically placed throughout your website UI, and they should be easily findable and identifiable while clearly indicating the action they allow a user to complete.
Usage
Code EditorCopyimport { Button } from '@erudilabs/alma'
Types
Code EditorCopyimport type { ButtonThemeProps, ButtonSizeProps } from '@erudilabs/alma'
ButtonThemeProps = 'default' | 'primary' | 'danger' | 'success' | 'warning'
ButtonSizeProps = 'small' | 'medium' | 'large'
Component
Here preview and detail explain of Button
component
Default
Code EditorCopy<Button>Default</Button>
Theme
These themes allow you to apply different visual styles to the Button
, Whether it's indicating different statuses, categories, or providing visual cues, the ability to customize Button
themes adds flexibility and enhances the visual appeal of your UI components.
Primary
Code EditorCopy<Button theme="primary">Primary</Button>
Danger
Code EditorCopy<Button theme="danger">Danger</Button>
Warning
Code EditorCopy<Button theme="warning">Warning</Button>
Success
Code EditorCopy<Button theme="success">Success</Button>
Outline
Default outline
Code EditorCopy<Button outline>Default Outline</Button>
Primary outline
Code EditorCopy<Button theme="primary" outline>Primary Outline</Button>
Danger outline
Code EditorCopy<Button theme="danger" outline>Danger Outline</Button>
Warning outline
Code EditorCopy<Button theme="warning" outline>Warning Outline</Button>
Success outline
Code EditorCopy<Button theme="success" outline>Success Outline</Button>
Size
Prop determines the dimensions of the button
, affecting its width
, height
, and padding
. You can define different sizes
Small
Code EditorCopy<Button theme="primary" size="small">Small</Button>
Medium
Code EditorCopy<Button theme="primary" size="medium">Medium</Button>
Large
Code EditorCopy<Button theme="primary" size="large">Large</Button>
Disabled
Code EditorCopy<Button theme="danger" disabled> Disabled </Button>
Block
Code EditorCopy<Button theme="success" block>Block</Button>
Loading
Code EditorCopy<Button theme="primary" loading>Continue</Button>
Props Reference
Prop
Type
Default
id?
string
-
testId?
string
-
children?
ReactNode
-
className?
string
-
theme?
ButtonThemeProps
default
size?
ButtonSizeProps
medium
disabled?
boolean
false
block?
boolean
false
loading?
boolean
false
outline?
boolean
false
onChange?
(e) => void
-
onBlur?
(e: FocusEvent) => void
-