Noora.Button
(noora v0.86.0)
Copy Markdown
A component for rendering both standard buttons and link-style buttons, offering flexible styling options for variants, sizes, and icon placement.
Summary
Functions
Attributes
label(:string) - Provides fallback text when the default slot is empty. Defaults to"".variant(:string) - Controls the visual emphasis and semantic intent. Defaults to"primary". Must be one of"primary","secondary", or"destructive".size(:string) - Controls the button dimensions and text size. Defaults to"large". Must be one of"small","medium", or"large".href(:any) - Uses traditional browser navigation to the new location. Defaults tonil.navigate(:string) - Navigates to a LiveView. Defaults tonil.patch(:string) - Patches the current LiveView. Defaults tonil.icon_only(:boolean) - Uses the default slot as the entire button content. An accessible label is required. Defaults tofalse.- Global attributes are accepted. Supports all globals plus:
["phx-click", "disabled", "form"].
Slots
icon_left- Icon displayed on the left of an item.icon_right- Icon displayed on the right of an item.inner_block- Inner block that renders HEEx content.
Attributes
label(:string) (required) - The label of the button.variant(:string) - Controls the visual emphasis and semantic intent. Defaults to"primary". Must be one of"primary","secondary", or"destructive".size(:string) - Controls the button dimensions and text size. Defaults to"large". Must be one of"small","medium", or"large".href(:any) - Uses traditional browser navigation to the new location. Defaults tonil.navigate(:string) - Navigates to a LiveView. Defaults tonil.patch(:string) - Patches the current LiveView. Defaults tonil.underline(:boolean) - Determines if the button is underlined. Defaults tofalse.- Global attributes are accepted.
Slots
icon_left- Icon displayed on the left of an item.icon_right- Icon displayed on the right of an item.
Attributes
variant(:string) - Controls the visual emphasis and semantic intent. Defaults to"primary". Must be one of"primary","secondary", or"destructive".size(:string) - Controls the button dimensions and text size. Defaults to"large". Must be one of"small","medium", or"large".href(:any) - Uses traditional browser navigation to the new location. Defaults tonil.navigate(:string) - Navigates to a LiveView. Defaults tonil.patch(:string) - Patches the current LiveView. Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["phx-click", "disabled"].
Slots
inner_block(required) - Inner block that renders HEEx content.