Noora.Button (noora v0.3.0)
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
) - The label of the button.variant
(:string
) - Determines the style. Defaults to"primary"
. Must be one of"primary"
,"secondary"
, or"destructive"
.size
(:string
) - Determines the overall size of the elements, including padding, font size, and other items. 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
) - Determines if the button is icon only. Defaults tofalse
.- Global attributes are accepted. Supports all globals plus:
["phx-click", "disabled"]
.
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
) - Determines the style. Defaults to"primary"
. Must be one of"primary"
,"secondary"
, or"destructive"
.size
(:string
) - Determines the overall size of the elements, including padding, font size, and other items. 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
) - Determines the style. Defaults to"primary"
. Must be one of"primary"
,"secondary"
, or"destructive"
.size
(:string
) - Determines the overall size of the elements, including padding, font size, and other items. 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.