Skip to main content

priv/registry/skeleton.json

{
  "files": [
    {
      "content": "defmodule Shadix.Components.Skeleton do\n  @moduledoc \"\"\"\n  Skeleton component, translated from the shadcn/ui `skeleton` component.\n\n  Renders a `<div>` with `data-slot=\"skeleton\"` used as a loading placeholder.\n\n  The pulse animation respects `prefers-reduced-motion`: under reduced motion\n  the `animate-pulse` loop is suppressed via `motion-reduce:animate-none`.\n  \"\"\"\n  use Phoenix.Component\n  import Shadix.Cn\n\n  attr(:class, :string, default: nil)\n  attr(:rest, :global)\n  slot(:inner_block)\n\n  def skeleton(assigns) do\n    class = cn([\"animate-pulse rounded-md bg-accent motion-reduce:animate-none\", assigns.class])\n    assigns = assign(assigns, :computed_class, class)\n\n    ~H\"\"\"\n    <div data-slot=\"skeleton\" class={@computed_class} {@rest}>{render_slot(@inner_block)}</div>\n    \"\"\"\n  end\nend\n",
      "path": "skeleton.ex"
    }
  ],
  "hooks": [],
  "name": "skeleton",
  "npm_deps": [],
  "registry_deps": [
    "cn"
  ]
}