Skip to content
Viewership Inquire
Astro UI

Button.

Pill-shaped action button in six variants and three sizes.

ActionsAtomNo dependencies Beautiful UI, MIT

.md

Install

  1. Import the foundation once

    foundation.css holds the tokens every component reads.

    Layout.astro
    ---
    // src/layouts/Layout.astro
    import "../styles/foundation.css";
    ---
  2. Copy Button.astro

    Paste into src/components/viewership/button/

  3. Use it

    Page.astro
    ---
    import Button from "../components/viewership/button/Button.astro";
    ---
    
    <Button />

Props 4

PropTypeDefaultDescription
variant "primary" | "secondary" | "ghost" | "accent" | "success" | "quiet" "secondary" Visual style.
size "xs" | "sm" | "md" "md" Height and padding.
href string · Renders an <a> instead of a <button>.
type "button" | "submit" | "reset" "button" Button type (ignored for links).

Source 1 file