OctantisWeb.Components.Polaris.Button (octantis v0.2.0)
View SourceCards are used to group similar concepts and tasks together for merchants to scan, read, and get things done. It displays content in a familiar and recognizable style.
Examples
<.button content="Save" />
<.button content="Delete">
<:icon><Icons.delete /></:icon>
</.button>
<.button variant="primary">
<:icon><Icons.delete /></:icon>
</.button>See
Summary
Functions
Cards are used to group similar concepts and tasks together for merchants to scan, read, and get things done. It displays content in a familiar and recognizable style.
Functions
Cards are used to group similar concepts and tasks together for merchants to scan, read, and get things done. It displays content in a familiar and recognizable style.
Examples
<.button content="Save" />
<.button content="Delete">
<:icon><Icons.delete /></:icon>
</.button>
<.button variant="primary">
<:icon><Icons.delete /></:icon>
</.button>See
- https://polaris.shopify.com/components/actions/button
- https://github.com/Shopify/polaris/blob/main/polaris-react/src/components/Button/Button.tsx
Attributes
class(:any) - The class to be passed down to the button.content(:string) - Content of the button. Defaults tonil.disabled(:boolean) - Whether or not the action is disabled. Defaults tofalse.size(:string) - Changes the size of the button, giving it more or less padding. Defaults to"medium".text_align(:string) - Changes the inner text alignment of the button. Defaults to"center".full_width(:boolean) - Allows the button to grow to the width of its container. Defaults tofalse.disclosure(:string) - Displays the button with a disclosure icon. Defaults todownwhen set to true.Must be one of"down","up", or"select".data_primary_link(:boolean) - Indicates whether or not the button is the primary navigation link when rendered inside of anIndexTable.Row.tone(:string) - Sets the color treatment of the Button.Must be one of"critical", or"success".variant(:string) - Changes the visual appearance of the Button. Defaults to"secondary".submit(:boolean) - Allows the button to submit a form. Defaults tofalse.name(:string) - Name to be passed down to the button. Defaults tonil.value(:string) - Name to be passed down to the button. Defaults tonil.phx_click(:any) - Defaults tonil.phx_target(:any) - Allows setting the target for the button. Defaults tonil.phx_values(:list) - A list of key value pairs to be passed as a value for actions. See assign_phx_bindings/2. Defaults to[].style(:string) - Style attribute.align_items(:string) - Style attribute.align_self(:string) - Style attribute.display(:string) - Style attribute.flex_grow(:string) - Style attribute.grid_auto_rows(:string) - Style attribute.grid_template_columns(:string) - Style attribute.grid_template_rows(:string) - Style attribute.justify_content(:string) - Style attribute.margin(:string) - Style attribute.max_height(:string) - Style attribute.min_height(:string) - Style attribute.object_fit(:string) - Style attribute.opacity(:string) - Style attribute.- Global attributes are accepted.
Slots
icon- Icon to display to the left of the button content.inner_block