View Source Doggo (Doggo v0.10.0)

This module only contains miscellaneous functions.

The components are defined in Doggo.Components.

Summary

JS

Hides the modal with the given ID.

Shows the modal with the given ID.

Shows the tab with the given index of the tabs/1 component with the given ID.

Functions

Returns all component classes used in the given components module.

Takes a modifier attribute name and value and returns a CSS class name.

JS

Link to this function

hide_modal(js \\ %JS{}, id)

View Source (since 0.1.0)

Hides the modal with the given ID.

Example

<.link phx-click={hide_modal("pet-modal")}>hide</.link>
Link to this function

show_modal(js \\ %JS{}, id)

View Source (since 0.1.0)

Shows the modal with the given ID.

Example

<.link phx-click={show_modal("pet-modal")}>show</.link>
Link to this function

show_tab(js \\ %JS{}, id, index)

View Source (since 0.5.0)

Shows the tab with the given index of the tabs/1 component with the given ID.

Example

Doggo.show_tab("my-tabs", 2)

Functions

@spec classes(module()) :: [String.t()]

Returns all component classes used in the given components module.

This includes the base classes, nested classes (based on the base class) and modifier classes.

Usage

iex> classes(MyAppWeb.CoreComponents)
[
  "button",
  "is-large",
  "is-medium",
  "is-primary",
  "is-secondary",
  "is-small"
]
Link to this function

modifier_class_name(_, value)

View Source
@spec modifier_class_name(atom(), String.t()) :: String.t()

Takes a modifier attribute name and value and returns a CSS class name.

This function is used as a default for the class_name_fun option.

Example

iex> modifier_class_name(:size, "large")
"is-large"