SigmaKit.Components.Buttons (sigma_kit v0.0.2)

Summary

Functions

Attributes

  • id (:string) (required)
  • class (:any) - Defaults to nil.

Slots

  • action - overflow items presented as a dropdown menu. Accepts attributes:
    • label (:string) - The label for the menu item.
    • event (:string) - The phx-click event for the menu item.
    • value (:string) - The phx-value for the menu item.
    • value_id (:string) - The phx-value-id for the menu item.
    • target (:string) - The phx-target for the menu item.
    • icon (:string) - The icon for the menu item.

Renders a simple button component.

Renders a dropdown button with a customizable label and a list of actions.

Renders a toggle switch with icons on the left and right sides.

Functions

action_dropdown(assigns)

Attributes

  • id (:string) (required)
  • class (:any) - Defaults to nil.

Slots

  • action - overflow items presented as a dropdown menu. Accepts attributes:
    • label (:string) - The label for the menu item.
    • event (:string) - The phx-click event for the menu item.
    • value (:string) - The phx-value for the menu item.
    • value_id (:string) - The phx-value-id for the menu item.
    • target (:string) - The phx-target for the menu item.
    • icon (:string) - The icon for the menu item.

button(assigns)

Renders a simple button component.

Attributes

  • class (:any) - Additional CSS classes to apply to the button. Defaults to nil.
  • primary (:boolean) - Apply the primary style to the button. Defaults to false.
  • dark (:boolean) - Apply a dark style to the button. Defaults to false.
  • light (:boolean) - Apply the light style to the button. Defaults to false.
  • danger (:boolean) - Apply the danger style to the button. Defaults to false.
  • inline (:boolean) - Apply the inline style to the button. Defaults to false.
  • Global attributes are accepted. Additional attributes to apply to the button. Supports all globals plus: ["type", "disabled", "form", "name", "value"].

Slots

  • inner_block (required) - The content to render inside the button.

icon_toggle_switch(assigns)

Renders a toggle switch with icons on the left and right sides.

Attributes

  • left_icon (:string) (required) - The name of the icon to display on the left side of the toggle switch.
  • right_icon (:string) (required) - The name of the icon to display on the right side of the toggle switch.
  • event (:string) (required) - The event name triggered when the toggle switch is clicked.
  • target (:any) - The target for the phx-click event. Defaults to nil.
  • left (:boolean) (required) - Determines if the toggle is in the 'left' position.
  • right (:boolean) (required) - Determines if the toggle is in the 'right' position.