Noora.Button (noora v0.1.0-rc.2)

A component for rendering both standard buttons and link-style buttons, offering flexible styling options for variants, sizes, and icon placement.

Summary

Functions

button(assigns)

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 to nil.
  • navigate (:string) - Navigates to a LiveView. Defaults to nil.
  • patch (:string) - Patches the current LiveView. Defaults to nil.
  • icon_only (:boolean) - Determines if the button is icon only. Defaults to false.
  • 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.

button_sizes()

button_variants()

neutral_button(assigns)

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 to nil.
  • navigate (:string) - Navigates to a LiveView. Defaults to nil.
  • patch (:string) - Patches the current LiveView. Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["phx-click", "disabled"].

Slots

  • inner_block (required) - Inner block that renders HEEx content.