PhoenixDuskmoon.Component.Skeleton (PhoenixDuskmoon v7.2.1)
View SourceDuskmoon UI Skeleton Component
Provides various skeleton loading placeholder formats using daisyui classes. Perfect for showing content placeholders while data is loading.
Summary
Functions
Generates a basic skeleton element.
Generates an avatar skeleton.
Generates a card skeleton placeholder.
Generates a comment skeleton placeholder.
Generates a form skeleton placeholder.
Generates a list skeleton placeholder.
Generates a table skeleton placeholder.
Generates a text skeleton with multiple lines.
Functions
Generates a basic skeleton element.
Examples
<.dm_skeleton />
<.dm_skeleton class="w-32 h-4" />
<.dm_skeleton variant="circle" size="md" />Attributes
id(:any) - Defaults tonil.class(:any) - Defaults tonil.variant(:string) - Skeleton variant (default, circle, square, text, avatar). Defaults tonil.size(:string) - Skeleton size (xs, sm, md, lg, xl). Defaults tonil.animation(:string) - Animation type (pulse, wave, bounce). Defaults tonil.width(:string) - Custom width (e.g., 'w-32', 'w-full'). Defaults tonil.height(:string) - Custom height (e.g., 'h-4', 'h-8'). Defaults tonil.
Generates an avatar skeleton.
Examples
<.dm_skeleton_avatar size="md" />
<.dm_skeleton_avatar size="lg" class="ring ring-primary" />Attributes
id(:any) - Defaults tonil.class(:any) - Defaults tonil.size(:string) - Avatar size (xs, sm, md, lg, xl). Defaults to"md".animation(:string) - Animation type. Defaults tonil.
Generates a card skeleton placeholder.
Examples
<.dm_skeleton_card />
<.dm_skeleton_card show_avatar={true} lines={4} />Attributes
id(:any) - Defaults tonil.class(:any) - Defaults tonil.show_avatar(:boolean) - Show avatar skeleton. Defaults tofalse.avatar_size(:string) - Avatar size. Defaults to"md".lines(:integer) - Number of text lines. Defaults to3.show_action(:boolean) - Show action button skeleton. Defaults tofalse.animation(:string) - Animation type. Defaults tonil.
Generates a comment skeleton placeholder.
Examples
<.dm_skeleton_comment />
<.dm_skeleton_comment show_replies={2} />Attributes
id(:any) - Defaults tonil.class(:any) - Defaults tonil.show_replies(:integer) - Number of reply skeletons to show. Defaults to0.animation(:string) - Animation type. Defaults tonil.
Generates a form skeleton placeholder.
Examples
<.dm_skeleton_form fields={4} show_submit={true} />
<.dm_skeleton_form fields={3} field_types={["text", "select", "textarea"]} />Attributes
id(:any) - Defaults tonil.class(:any) - Defaults tonil.fields(:integer) - Number of form fields. Defaults to4.field_types(:list) - List of field types (text, select, textarea, checkbox). Defaults tonil.show_submit(:boolean) - Show submit button skeleton. Defaults totrue.animation(:string) - Animation type. Defaults tonil.
Generates a list skeleton placeholder.
Examples
<.dm_skeleton_list items={5} show_avatar={true} />
<.dm_skeleton_list items={3} lines_per_item={2} />Attributes
id(:any) - Defaults tonil.class(:any) - Defaults tonil.items(:integer) - Number of list items. Defaults to5.show_avatar(:boolean) - Show avatar for each item. Defaults tofalse.avatar_size(:string) - Avatar size. Defaults to"sm".lines_per_item(:integer) - Number of text lines per item. Defaults to1.animation(:string) - Animation type. Defaults tonil.
Generates a table skeleton placeholder.
Examples
<.dm_skeleton_table rows={5} columns={4} />
<.dm_skeleton_table rows={3} columns={2} show_header={true} />Attributes
id(:any) - Defaults tonil.class(:any) - Defaults tonil.rows(:integer) - Number of table rows. Defaults to5.columns(:integer) - Number of table columns. Defaults to4.show_header(:boolean) - Show table header. Defaults totrue.animation(:string) - Animation type. Defaults tonil.
Generates a text skeleton with multiple lines.
Examples
<.dm_skeleton_text lines={3} />
<.dm_skeleton_text lines={2} last_line_width="w-3/4" />Attributes
id(:any) - Defaults tonil.class(:any) - Defaults tonil.lines(:integer) - Number of skeleton lines. Defaults to3.line_height(:string) - Height of each line. Defaults to"h-4".line_spacing(:string) - Spacing between lines. Defaults to"mb-2".last_line_width(:string) - Width of the last line. Defaults to"w-full".animation(:string) - Animation type. Defaults tonil.