# gnostic UI > Build fast business websites with shadcn UI components and blocks for Astro. Install editable source and bring your own brand palette. # Shadcn components. Built for Astro. Source: https://ui.gnosticai.com/ Build fast business websites with polished Astro components and complete page blocks. Bring your content and brand palette. Keep the source. ## Browse the library - [Astro UI components](/components): buttons, forms, dialogs, navigation, and more. - [Astro page blocks](/blocks): heroes, services, reviews, contact sections, and footers. - [Background patterns](/patterns): dots, grids, and glow effects that use your theme colors. - [Astro themes](/themes): one preset for colors, fonts, radius, and component styles. - [Component examples](/examples/overview): see the parts used together. ## Start at the scale you need Choose a [component](/components), compose a [page block](/blocks), and add a [background pattern](/patterns). The homepage uses simple form, feature section, and dot pattern sketches that follow the selected preset in light and dark mode. Its hero and floating call to action use the shared [CTA button](/components/cta-button). ## Built for websites A business website does not need to be a React app. Gnostic uses Astro markup, Tailwind CSS, and small browser scripts where interaction needs them. Install editable source through the shadcn registry and use Astro props and slots to compose your pages. Read the [project credits](/docs/credits) for the shadcn, Fulldev, and Coss foundations. Follow the [local business website guide](/docs/astro-business-websites) to plan service pages, choose blocks, and prepare page content for search. Astro serves HTML; your site still needs useful content, accurate metadata, and internal links. ## Bring your own brand palette Use the [theme generator](/themes) to choose a complete preset. Preview the palette, font, radius, and component styles before installation. Read the [theming guide](/docs/theming) for the supported options. ## Start building Add the Gnostic registry to your Astro project: ```sh bunx --bun shadcn@latest registry add "@gnostic=https://ui.gnosticai.com/r/{name}.json" ``` The homepage shows this command in a centered floating section with a copy button. 1. Follow the [Astro installation guide](/docs/installation). 2. Choose your design in the [theme generator](/themes). 3. Add [components](/components) and [blocks](/blocks) through the shadcn CLI. Inspect the examples and source before you install. Contact blocks supply the interface; connect form submissions to your chosen backend. The reusable components, blocks, and patterns are available now. --- # website Blocks for Astro Source: https://ui.gnosticai.com/blocks Choose a block from the content you need to present: an introduction, a service offer, a reading section, or site navigation. Each layout has a descriptive heading, an Astro source example, and its own install command. Use the source for the exact layout because its props can differ from other variants. ## Build a local business website Follow the [local business website guide](/docs/astro-business-websites) to plan service pages and connect your content to the right blocks. Start with a [hero](/blocks/hero), [services](/blocks/services), and [contact section](/blocks/contact). ## Keep sections reusable Load collections and route data in your page or template, then pass only the required content to the block. Use local image imports when a prop expects Astro ImageMetadata. Replace sample links and labels with content that describes the actual site. ## Check the complete page Review heading order, spacing between sections, and image crops at narrow and wide widths. A block can fit on its own while the complete page still has repeated headings or conflicting actions. Use the shared theme tokens across sections and test both light and dark modes. See [Templates](/templates) for full-page composition and [Credits](/docs/credits) for the project sources. Blocks are grouped by function. Templates compose these same blocks with one complete preset. For example, Gnotch selects Graphite and Portfolio selects Glow. Install a block on its own to use it with your project preset. --- # Article Blocks for Astro Source: https://ui.gnosticai.com/blocks/article ## Image header Lead with an image, then keep the author details close to the article title. ```astro --- import Article1Block from "@/components/blocks/article/article-1.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" ---

Start by checking the tasks that remain open. A task can be unfinished because the work is large, a question is unanswered, or the next step has no owner. Record the reason before changing the date.

Ask the team to choose a small number of next actions. Give each action an owner and write down the information that person needs. Keep new ideas in a separate list until the current work has a clear direction.

Finish by reading the decisions aloud. A teammate who missed the discussion should be able to use the notes without asking the same questions again. Review those notes at the start of the next meeting.

``` ```sh bunx --bun shadcn@latest add @gnostic/article-1 ``` ## Centered header Center the title and author details before the reading column. ```astro --- import Article2Block from "@/components/blocks/article/article-2.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" ---

Start an issue by collecting questions from readers. Group the questions by topic and choose one that the next story can answer clearly. Leave the remaining ideas in the editorial list.

Prepare a brief with the reader question, the planned sources, and the checks the draft will need. Give the writer a date for the first review and explain which details are still uncertain.

Read the draft for meaning before changing individual sentences. Check each claim against its source and make sure the ending gives the reader a useful next step. Keep the review notes with the issue.

``` ```sh bunx --bun shadcn@latest add @gnostic/article-2 ``` ## Editorial article Use this section for a case study or journal entry. ```astro --- import Section from "@/components/blocks/content/content-agency-article.astro" const section = { label: "Original concept project", title: "Rook & Stone", description: "A quiet identity and project archive for a residential architecture practice.", image: { src: "/media/foldline/rook-stone.webp", alt: "Limestone courtyard house with an olive tree and reflecting pool", }, metadata: [ { label: "Client concept", value: "Rook & Stone", }, { label: "Scope", value: "Brand strategy, Studio website", }, { label: "Year", value: "2026", }, ], sections: [ { title: "The challenge", description: "Rook & Stone is a fictional residential practice with a patient approach to materials and light. Its concept brief called for an identity that could feel precise without becoming cold, and a website that could explain a home without turning it into a list of features.", }, { title: "The approach", description: "We paired a restrained wordmark with warm photography and short project notes. The archive starts with a view of each house, then moves through its setting, plan, and material choices. A small set of page patterns keeps new case studies easy to publish.", }, { title: "The outcome", description: "The concept brings the practice’s point of view into focus. Visitors can browse the work, understand how the team thinks, and start a relevant conversation. This is an original demonstration project for the Foldline sample brand.", }, ], back: { label: "All concept projects", href: "https://example.com/projects", }, } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/content-agency-article ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Choose a article layout Choose an article layout for one long-form page. Keep the title specific and use the description to set the scope. Author and date details should describe the actual publication, not the demo content. ## Pass content from Astro Pass the heading, author object, and image required by the chosen block. Place the article body in the supported content slot. The template owns collection queries and the route; the reusable block only receives the resulting content. ## Responsive layout and images Check line length, long headings, code, and tables on small screens. Supply image dimensions through the expected Astro image type and use a crop that still makes sense beside the title. A decorative lead image can have empty alt text; an informative image needs an accurate description. ## Compose the next section Use [Articles](/blocks/articles) for a listing, [Doc](/blocks/doc) for a reference page, and [Typeset](/docs/theming#text-and-headings) for prose styles. --- # Articles Blocks for Astro Source: https://ui.gnosticai.com/blocks/articles ## Featured grid Give one story more space while keeping related stories in the same collection. ```astro --- import Articles1Block from "@/components/blocks/articles/articles-1.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/articles-1 ``` ## Featured sidebar Place the lead story beside a smaller set of related articles. ```astro --- import Articles2Block from "@/components/blocks/articles/articles-2.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/articles-2 ``` ## Rows Use rows when readers need to compare several article summaries. ```astro --- import Articles3Block from "@/components/blocks/articles/articles-3.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/articles-3 ``` ## Text grid Use text cards when the titles and summaries carry the collection. ```astro --- import Articles4Block from "@/components/blocks/articles/articles-4.astro" import { agentAvatars } from "@/lib/agent-avatars" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/articles-4 ``` ## Editorial blog Use this section for the blog part of a studio site. ```astro --- import Section from "@/components/blocks/blog/blog-agency.astro" const section = { label: "Field notes", title: "A closer", accent: "look", articles: [ { title: "A project is more than a gallery", description: "Five useful details that help people understand a space, beyond the finished photographs.", href: "https://example.com/blogs/a-project-is-more-than-a-gallery", date: "2026-09-18", image: { src: "/media/foldline/rook-stone.webp", alt: "Light and shadow in a limestone courtyard", }, }, { title: "A material-led identity", description: "How texture, proportion, and a limited palette can give a studio a clear visual voice.", href: "https://example.com/blogs/a-material-led-identity", date: "2026-08-27", image: { src: "/media/foldline/material-study.svg", alt: "Isometric study of stone, timber, and paper samples", }, }, { title: "Photography with room to breathe", description: "A practical way to sequence images so that a visitor can move through the work.", href: "https://example.com/blogs/photography-with-room-to-breathe", date: "2026-07-09", image: { src: "/media/foldline/morrow-rooms.webp", alt: "Soft daylight falling across a guesthouse lounge", }, }, { title: "The case for a small website", description: "Why a focused set of pages can do more for a practice than a crowded digital archive.", href: "https://example.com/blogs/the-case-for-a-small-website", date: "2026-06-16", image: { src: "/media/foldline/editorial-grid.svg", alt: "An isometric set of simple editorial page layouts", }, }, { title: "Writing about objects", description: "Make dimensions, materials, and making part of a clear product story.", href: "https://example.com/blogs/writing-about-objects", date: "2026-05-21", image: { src: "/media/foldline/tern-objects.webp", alt: "Walnut chair and oak table with a ceramic vessel", }, }, ], } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/blog-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Journal grid Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/content/content-journal-grid/content-journal-grid.astro" import type { JournalGridContent } from "@/components/blocks/content/content-journal-grid/types" const content = { posts: [ { label: "AI agents", title: "Give your AI agent one job, and a clear stopping point.", date: "2026-10-22", description: "A focused brief makes an agent easier to test, review, and improve.", image: { src: "/media/gnotch/human-in-the-loop.webp", alt: "A silver circular track with a gate and a waiting white sphere", }, href: "/blog/ai-agents", }, { label: "Operations", title: "The hand-off is often where the time goes.", date: "2026-10-16", description: "Look between your tools to find the repeated work hiding in plain sight.", image: { src: "/media/gnotch/connected-work.webp", alt: "Three graphite channels join into one silver path", }, href: "/blog/save-time", }, { label: "Team practice", title: "Make your first AI rollout a team exercise.", date: "2026-10-09", description: "The people doing the work should help define what better looks like.", image: { src: "/media/gnotch/workshop.webp", alt: "A small group working together with laptops", }, href: "/blog/ai-adoption", }, { label: "Workflow design", title: "Turn an enquiry into a brief your team can use.", date: "2026-10-02", description: "A practical outline for a first intake workflow.", image: { src: "/media/gnotch/signal-from-noise.webp", alt: "Rough graphite pieces become aligned silver cubes inside a glass prism", }, href: "/blog/workflow-automation", }, { label: "Human review", title: "Put approval where a mistake would matter.", date: "2026-09-25", description: "Design a review point that gives people enough context to decide.", image: { src: "/media/gnotch/project-review.webp", alt: "A project discussion around an office table", }, href: "/blog/manual-or-automated", }, { label: "Measurement", title: "Measure the work you remove, not the runs you add.", date: "2026-09-18", description: "A busy automation log is not the same as a useful outcome.", image: { src: "/media/gnotch/desk-session.webp", alt: "Colleagues reviewing a task at a laptop", }, href: "/blog/measure-results", }, ], } satisfies JournalGridContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-journal-grid ``` ## Choose a articles layout Choose a list or grid based on how many articles a reader must compare. Use consistent categories and dates so each card supplies the same kind of information. ## Pass content from Astro Pass an articles array with the fields required by the selected variant. The first variant includes title, description, category, optional href, image, and author data. Sort and paginate in the route or data layer before passing the array. ## Responsive layout and images Check mixed title lengths and missing author images at narrow widths. Use deliberate thumbnail crops and avoid downloading full-size lead images for every card. A responsive grid changes the layout; it does not fetch additional pages. ## Compose the next section Pair the listing with an [Article](/blocks/article) detail page and [Pagination](/components/pagination) when the route has several pages of results. --- # Banner Blocks for Astro Source: https://ui.gnosticai.com/blocks/banner ## Inline announcement Keep a short announcement and its destination together. ```astro --- import Banner1Block from "@/components/blocks/banner/banner-1.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/banner-1 ``` ## Floating actions Give an inset announcement room for two action links. ```astro --- import Banner2Block from "@/components/blocks/banner/banner-2.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/banner-2 ``` ## Choose a banner layout Choose a banner for a temporary service message or an announcement that belongs across several pages. Keep it short enough that it does not dominate the header. ## Pass content from Astro Pass the title, description, and optional link accepted by the variant. Use the link for the page that explains the notice. If a variant supports dismissal, make sure important information remains available after it closes. ## Responsive layout and images Check the message and action together on a phone. Text should wrap without hiding the close control. These layouts are text-led; an image is rarely needed. Inspect contrast on the selected banner surface in both modes. ## Compose the next section Use [Alert](/components/alert) for a message tied to one page region and [Header](/blocks/header) for primary navigation. --- # Contact Blocks for Astro Source: https://ui.gnosticai.com/blocks/contact Each block renders a real form with named, required fields and a submit button. Set `form.action` to your form handler and `form.method` to `"post"` (the default) or `"get"`. The blocks do not provide a submission backend. Pass `form.id` for a stable form ID; field IDs use it as their prefix. ## Split form Place contact methods beside a labelled enquiry form. ```astro --- import Contact1Block from "@/components/blocks/contact/contact-1.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/contact-1 ``` ## Centered form Give the form a central position after the contact introduction. ```astro --- import Contact2Block from "@/components/blocks/contact/contact-2.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/contact-2 ``` ## Sidebar form Keep the contact information available beside the enquiry fields. ```astro --- import Contact3Block from "@/components/blocks/contact/contact-3.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/contact-3 ``` ## Contact details and form Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/contact/contact-details-form/contact-details-form.astro" import type { DetailsFormContent } from "@/components/blocks/contact/contact-details-form/types" const content = { email: "hello@gnotch.example", phone: "+1 (212) 555-0148", hours: "Monday–Friday, 9 AM–5 PM ET", address: "New York · Working everywhere", label: "Prepare email", description: "This form opens your email app. Review and send your message there.", } satisfies DetailsFormContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/contact-details-form ``` ## Editorial contact Use this section for a project enquiry with a form endpoint or email draft fallback. ```astro --- import Section from "@/components/blocks/contact/contact-agency.astro" const section = { label: "Your next chapter", title: "Make room", accent: "for what’s next", description: "Tell us about your practice and the story you want to tell. We will help you find a useful place to start.", email: "hello@foldline.example", companyTypes: [ "Architecture practice", "Interior design studio", "Furniture maker", "Hospitality", "Other", ], serviceOptions: [ "Brand foundations", "Studio website", "Project stories", "Launch support", "Other", ], buttonLabel: "Create email draft", formTitle: "Tell us about your studio", image: { src: "/media/foldline/fold-sculpture.svg", alt: "", }, } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/contact-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Home services area ```astro --- import Block from "@/components/blocks/contact/contact-remodify-area.astro" const content = { eyebrow: "Close to Home", title: "Rooted in Raleigh.", map: { src: "https://www.openstreetmap.org/export/embed.html?bbox=-78.98%2C35.63%2C-78.48%2C35.99&layer=mapnik", title: "Map of Raleigh, Cary, Apex, and nearby communities", href: "https://www.openstreetmap.org/#map=11/35.80/-78.73", label: "Explore the Raleigh service area", }, mapTitle: "Your Neighborhood. Your Home.", description: "Planning a remodel in the Triangle? Tell us where you live and what you have in mind.", locations: [ "Raleigh", "Cary", "Apex", "Morrisville", "Garner", "Wake Forest", "Holly Springs", "Knightdale", ], benefits: [ "Kitchen and bathroom remodeling", "Whole-home renovations", "Interior updates and finish carpentry", ], action: { label: "Check Your Location", href: "#contact", }, phone: { label: "(919) 555-0142", href: "tel:+19195550142", }, } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/contact-remodify-area ``` ## Home services contact ```astro --- import Block from "@/components/blocks/contact/contact-remodify.astro" const content = { eyebrow: "Start With a Conversation", title: "What Could Home Be?", description: "Tell us about your space, location, and plans. The next step is a conversation about what is possible.", image: { src: "https://images.unsplash.com/photo-1762146828422-50a8bd416d3c?auto=format&fit=max&w=1600&q=80", alt: "Architectural drawings spread across a work surface", }, services: [ "Kitchen Remodeling", "Bathroom Remodeling", "Whole-Home Renovation", "Interior Updates", ], budgets: [ "Under $25,000", "$25,000 - $75,000", "$75,000 - $150,000", "$150,000+", "Help me plan a budget", ], submitLabel: "Discuss My Remodel", demoNotice: "Sample form. No request will be sent.", demoMessage: "Your sample request is complete. No message was sent.", } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/contact-remodify ``` ## Business hours and booking An address, opening hours, email, and a configurable booking link. ```astro --- import Block from "@/components/blocks/contact/contact-hours.astro" const content = { eyebrow: "Come as you are", title: "Make a little time\nfor yourself.", description: "Tell us what you have in mind. We will help you find the right appointment.", address: ["Sable Hair Studio", "12 Example Street", "Your town"], hours: [ { label: "Tuesday–Friday", value: "10 am–7 pm", }, { label: "Saturday", value: "9 am–5 pm", }, { label: "Sunday–Monday", value: "Closed", }, ], action: { label: "Email for an appointment", href: "mailto:hello@example.com", }, email: "hello@example.com", note: "Demo salon. Address, hours, and prices are sample content.", } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/contact-hours ``` ## Choose a contact layout Choose the contact layout from the ways people can actually reach you. A small site may need only direct links; a detailed enquiry can use a form with a short explanation of the next step. ## Pass content from Astro Contact form variants accept content labels and form action/method props. Connect those to a real endpoint or Astro action. The block displays the form but does not send mail, validate server-side rules, or store submissions by itself. ## Responsive layout and images Check label wrapping, error messages, and keyboard order on a narrow screen. Keep email and phone links usable without the form. If a variant includes an image, supply useful context rather than an image that competes with the fields. ## Compose the next section Place [Services](/blocks/services) or [FAQs](/blocks/faqs) before contact when they answer common questions. Use [Field](/components/field) for extra form fields. --- # Content Blocks for Astro Source: https://ui.gnosticai.com/blocks/content ## Stacked media Put the explanation before a full-width media area. ```astro --- import Content1Block from "@/components/blocks/content/content-1.astro" import Photo from "@/assets/images/winter-landscape-orion.png" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-1 ``` ## Split media Keep a supporting image beside the explanation. ```astro --- import Content2Block from "@/components/blocks/content/content-2.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-2 ``` ## Spread header Arrange the heading and actions above the media. ```astro --- import Content3Block from "@/components/blocks/content/content-3.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-3 ``` ## Wide media Give the media more room than the supporting text. ```astro --- import Content4Block from "@/components/blocks/content/content-4.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-4 ``` ## Product introduction Place partner logos above a large heading and product image. ```astro --- import Block from "@/components/blocks/content/content-nimbus-introduction.astro" const content = { title: "A little more room for your day.", description: "Meet Loom, a fictional home assistant designed for everyday tasks.", image: { src: "/images/nimbus-sample.svg", alt: "Product sample", }, logos: [ { src: "/favicon.svg", alt: "Sample studio", }, ], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-nimbus-introduction ``` ## Results and method Pair a main result with metric cards and expandable method notes. ```astro --- import Block from "@/components/blocks/content/content-nimbus-signals.astro" const content = { eyebrow: "Sample results", title: "Show the results and their limits.", description: "These fictional values show how to present a small product trial.", headline: "90% active each week.", summary: "Example activity after the first month.", metrics: [ { label: "Active homes", value: "90%", description: "Homes that used the product during the week.", source: "Fictional sample", }, { label: "Setup time", value: "35 min", description: "Median time from unpacking to the first task.", source: "Fictional sample", }, { label: "Trial homes", value: "120", description: "Homes included in this example.", source: "Fictional sample", }, ], methodologyTitle: "How we count", methodologyDescription: "Explain the sample and the method.", methodology: [ { question: "What is an active home?", answer: "A home that completed at least one task during the week.", }, { question: "Are these real results?", answer: "No. These are sample values for this block preview.", }, ], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-nimbus-signals ``` ## Content Portfolio About An independent section from the Portfolio template. Supply its content through props. ```astro --- import Block from "@/components/blocks/content/content-portfolio-about.astro" import asset0 from "../../../../../packages/templates/sable/site/src/assets/sable/stylist-at-work.png" import asset1 from "../../../../../packages/templates/sable/site/src/assets/sable/sculpted-bob.png" import asset2 from "../../../../../packages/templates/sable/site/src/assets/sable/natural-curls.png" import asset3 from "../../../../../packages/templates/sable/site/src/assets/sable/soft-balayage.png" import asset4 from "../../../../../packages/templates/sable/site/src/assets/sable/textured-crop.png" import asset5 from "../../../../../packages/templates/sable/site/src/assets/sable/silver-pixie.png" import asset6 from "../../../../../packages/templates/sable/site/src/assets/sable/loose-waves.png" const content = { title: "Rowan · Hair stylist", description: "A sample profile for an independent stylist. Soft shapes, natural movement, and practical care are at the centre of this fictional studio.", image: { src: asset0, alt: "A stylist finishing shoulder-length hair with a brush and dryer", }, skills: ["Precision cuts", "Colour", "Curly hair", "Styling"], experience: [ { role: "Independent stylist", company: "Example studio", period: "Now", }, { role: "Stylist", company: "Example salon", period: "2021–2025", }, ], projects: [ { src: asset1, alt: "A chin-length dark bob with a soft fringe", name: "The sculpted bob", href: "#visit", label: "The sculpted bob", }, { src: asset2, alt: "Shoulder-length natural curls in soft daylight", name: "Natural curls", href: "#visit", label: "Natural curls", }, { src: asset3, alt: "Long brunette hair with subtle caramel colour", name: "Soft balayage", href: "#visit", label: "Soft balayage", }, { src: asset4, alt: "A short coily crop with a soft taper", name: "The textured crop", href: "#visit", label: "The textured crop", }, { src: asset5, alt: "A textured silver pixie cut", name: "Silver, softly shaped", href: "#visit", label: "Silver, softly shaped", }, { src: asset6, alt: "Shoulder-length dark waves with a soft face frame", name: "Everyday waves", href: "#visit", label: "Everyday waves", }, ], projectsId: "looks", } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-portfolio-about ``` ## Split statement Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/content/content-split-statement/content-split-statement.astro" import type { SplitStatementContent } from "@/components/blocks/content/content-split-statement/types" const content = { value: "01", title: "One useful workflow is a better start than a hundred new tools.", description: "Start with the task your team repeats every day. Build it well. Then take the next step.", } satisfies SplitStatementContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-split-statement ``` ## Story and statistics Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/content/content-story-stats/content-story-stats.astro" import type { StoryStatsContent } from "@/components/blocks/content/content-story-stats/types" const content = { label: "Our point of view", title: "A Studio Built Around the Next Useful Step", description: "We believe good automation starts small, makes sense to the people using it, and gets better with use.", milestones: [ { label: "Observe", title: "Start at the shared desk.", description: "Watch how a real request moves through the business. The useful details are often in the small steps between tools.", image: { src: "/media/gnotch/workshop.webp", alt: "A small group working together with laptops", }, }, { label: "Connect", title: "Keep what already works.", description: "A familiar tool with a better connection can do more than another dashboard. We build around the systems your team knows.", image: { src: "/media/gnotch/desk-session.webp", alt: "Colleagues reviewing a task at a laptop", }, }, { label: "Explain", title: "Make the system readable.", description: "Your team should know what runs, when it runs, and what to do if it stops. Clear instructions are part of the product.", image: { src: "/media/gnotch/project-review.webp", alt: "A project discussion around an office table", }, }, { label: "Improve", title: "Leave room for the next step.", description: "Listen to the people who use the workflow. Fix the rough edges, measure the result, and add only what the work needs.", image: { src: "/media/gnotch/team-working.webp", alt: "Colleagues sharing ideas around a work table", }, }, ], } satisfies StoryStatsContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-story-stats ``` ## Editorial about Use this section for the about part of a studio site. ```astro --- import Section from "@/components/blocks/content/content-agency.astro" const section = { label: "A studio for studios", title: "You shape the places people live. We shape the way people find, understand, and remember your work.", description: "Foldline brings brand design, editorial thinking, and web development to architecture and interiors. Small team. Close conversations. Care in every detail.", wordmark: "foldline", stats: [ { label: "Connected disciplines", value: "03", }, { label: "Shared project team", value: "01", }, { label: "Clear project stages", value: "04", }, ], } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/content-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Editorial project milestones Use this list for awards or project milestones. Foldline uses it to describe the work in each concept project. ```astro --- import Section from "@/components/blocks/awards/awards-agency.astro" const section = { label: "Inside the projects", title: "Small details,", accent: "lasting value", awards: [ { organization: "Rook & Stone", title: "A clearer studio story", project: "Positioning & identity", }, { organization: "Morrow Rooms", title: "A warmer first impression", project: "Art direction & content", }, { organization: "Tern Objects", title: "A collection with room to grow", project: "Catalogue & website", }, { organization: "Foldline", title: "One connected way of working", project: "Strategy, design & build", }, ], } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/awards-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Home services introduction ```astro --- import Block from "@/components/blocks/content/content-remodify-introduction.astro" const content = { brand: "Remodify", title: "Keep the place you love. Change the way it lives.", images: [ { src: "https://images.unsplash.com/photo-1770756051811-1612ac8bedfa?auto=format&fit=max&w=1600&q=80", alt: "White home with dark windows and glass garage doors", }, { src: "https://images.unsplash.com/photo-1696814543783-c0835c0be682?auto=format&fit=max&w=1600&q=80", alt: "Bright kitchen with white cabinets, wood flooring, and orange breakfast chairs", }, { src: "https://images.unsplash.com/photo-1729173078273-3ee243b9273b?auto=format&fit=max&w=1600&q=80", alt: "Bathroom with a blue bathtub and a large window", }, { src: "https://images.unsplash.com/photo-1726090401458-7abb00f7450c?auto=format&fit=max&w=1600&q=80", alt: "Living room with timber beams and a stone fireplace", }, { src: "https://images.unsplash.com/photo-1771888703723-01d85da1dae1?auto=format&fit=max&w=1600&q=80", alt: "Open living space with neutral sofas and curved chairs", }, { src: "https://images.unsplash.com/photo-1762146828422-50a8bd416d3c?auto=format&fit=max&w=1600&q=80", alt: "Architectural drawings spread across a work surface", }, ], trustTitle: "Good spaces start with a good plan.", description: "We help Raleigh homeowners connect the details, from the first layout to the last cabinet handle.", benefits: [ { title: "A clear scope", icon: "clipboard-check", }, { title: "Care in every detail", icon: "hammer", }, { title: "One point of contact", icon: "messages-square", }, ], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-remodify-introduction ``` ## Home services confidence ```astro --- import Block from "@/components/blocks/content/content-remodify-confidence.astro" const content = { title: "Less Guesswork. More Home.", description: "Your remodel should fit your routines as well as your rooms. We listen first, explain the options, and agree on the work before it begins.", benefits: [ "Room layouts shaped around your needs", "A written scope and itemized estimate", "Regular updates and a tidy work area", ], action: { label: "(919) 555-0142", href: "tel:+19195550142", }, image: { src: "https://images.unsplash.com/photo-1769353086138-19ee65291a04?auto=format&fit=max&w=1600&q=80", alt: "Carpenter shaping a piece of wood in a workshop", }, stats: [ { value: "01", label: "Dedicated project contact", }, { value: "04", label: "Clear steps from idea to finish", }, ], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-remodify-confidence ``` ## Video demonstration A local video with a poster, playback controls, and a caption. ```astro --- import Block from "@/components/blocks/content/content-video-demo.astro" import poster from "../../../../../packages/templates/nimbus/site/src/assets/nimbus-dishes.png" import video from "../../../../../packages/templates/nimbus/site/src/assets/nimbus-robot-doing-dishes.mp4?url" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-video-demo ``` ## Split image and story An imported image beside plain text and an optional action. ```astro --- import Block from "@/components/blocks/content/content-split-story.astro" import asset0 from "../../../../../packages/templates/sable/site/src/assets/sable/stylist-at-work.png" const content = { eyebrow: "Our kind of salon", title: "Room to slow down.\nSpace to be you.", paragraphs: [ "We like good conversations, honest advice, and hair that still feels right weeks after your appointment. Sable is built around those simple things.", "Bring a picture, a question, or no plan at all. We will listen first and work out the next step together.", ], image: { src: asset0, alt: "A stylist finishing shoulder-length hair with a brush and dryer", }, action: { label: "Plan your first visit", href: "#visit", }, } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-split-story ``` ## Choose a content layout Choose a content layout that fits the balance between your text and media. A short explanation can sit beside one image; a longer story may need several sections with separate headings. ## Pass content from Astro Pass the chosen variant’s title, description, optional features, buttons, and image data. Keep the text structured rather than placing an entire page in one description string. Use slots where the block exposes them for richer markup. ## Responsive layout and images Review the order when columns stack on small screens. Import local images for props typed as ImageMetadata and choose a crop suited to the displayed ratio. Check that text remains readable when the image is missing or delayed. ## Compose the next section Use [Hero](/blocks/hero) for the opening statement, [Features](/blocks/features) for a set of benefits, and [CTA](/blocks/cta) for the next action. --- # Astro Call to Action blocks Source: https://ui.gnosticai.com/blocks/cta ## Centered Center the invitation and keep its actions together. ```astro --- import CallToActionBlock from "@/components/blocks/cta/cta-1.astro" import { agentAvatars } from "@/lib/agent-avatars" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/cta-1 ``` ## Split Use separate columns for the invitation and its supporting content. ```astro --- import Cta2Block from "@/components/blocks/cta/cta-2.astro" import { agentAvatars } from "@/lib/agent-avatars" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/cta-2 ``` ## Spread Spread the message and actions across the section. ```astro --- import Cta3Block from "@/components/blocks/cta/cta-3.astro" import { agentAvatars } from "@/lib/agent-avatars" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/cta-3 ``` ## Background Place a short invitation on a background surface. ```astro --- import Cta4Block from "@/components/blocks/cta/cta-4.astro" import { agentAvatars } from "@/lib/agent-avatars" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/cta-4 ``` ## Checklist Add a short checklist before the next action. ```astro --- import Cta5Block from "@/components/blocks/cta/cta-5.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/cta-5 ``` ## Reversed Reverse the content order to fit the surrounding sections. ```astro --- import Cta6Block from "@/components/blocks/cta/cta-6.astro" import { agentAvatars } from "@/lib/agent-avatars" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/cta-6 ``` ## Tinted Use a tinted surface to separate the invitation from adjacent content. ```astro --- import Cta7Block from "@/components/blocks/cta/cta-7.astro" import { agentAvatars } from "@/lib/agent-avatars" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/cta-7 ``` ## Subtle Keep the message short when the page has already explained the offer. ```astro --- import Cta8Block from "@/components/blocks/cta/cta-8.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/cta-8 ``` ## Orbit call to action Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/cta/cta-orbit/cta-orbit.astro" import type { OrbitCtaContent } from "@/components/blocks/cta/cta-orbit/types" const content = { title: "Your Next Chapter Starts with One Better Workflow.", buttons: [ { label: "Find your first workflow", href: "/contact", }, { label: "Meet the studio", href: "/about", }, ], label: "Gnotch", } satisfies OrbitCtaContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/cta-orbit ``` ## Home services ticker ```astro --- import Block from "@/components/blocks/cta/cta-remodify-ticker.astro" const content = { labels: ["Make Room for Life", "Keep What You Love", "Make Home Yours"], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/cta-remodify-ticker ``` ## Choose a layout Choose a CTA after the reader has enough information to act. State what happens next, such as viewing plans or sending an enquiry, instead of using a vague action label. ## Pass content from Astro Pass the title, description, and button links required by the block. Some variants also accept avatars, a rating, and proof text. Use those fields only for accurate evidence and keep the main action clear. ## Responsive layout and images Check the button row and heading on narrow screens. Optional avatars need real image sources or useful initials; they should not become unexplained decorative people. Theme contrast must remain sufficient on tinted CTA backgrounds. ## Compose the next section Use [Pricing](/blocks/pricing) before a purchase action and [Contact](/blocks/contact) for an enquiry. A CTA link alone does not implement checkout or a form submission. --- # Doc Blocks for Astro Source: https://ui.gnosticai.com/blocks/doc ## Guide Use a reading column with contents links, a callout, and previous and next navigation. ```astro --- import Doc1Block from "@/components/blocks/doc/doc-1.astro" ---

Prepare the review

Gather the current project brief, the open task list, and the notes from your previous review. Check that each document describes the same milestone before you invite the team.

Discuss open questions

Start the discussion with questions that prevent progress. Decide which questions can be answered now and assign the remaining checks to a named person. Record the reason for each decision.

When the question list is empty

When there are no open questions, use the time to check unfinished tasks. Confirm whether each task still belongs in the current milestone rather than adding work to fill the meeting.

Agree on next actions

Close the review with a short list of actions. Give each action an owner, a next step, and a date for the next check. Share the notes with anyone who could not attend.

``` ```sh bunx --bun shadcn@latest add @gnostic/doc-1 ``` ## Choose a doc layout Choose a doc layout for material that readers will scan and revisit. Keep the title specific and organize the body into stable headings that can be linked directly. ## Pass content from Astro Pass the title, description, table-of-contents items, labels, and navigation links required by the variant. The copy button reads the current page path and copies the text from that path with a `.md` extension. The block does not discover collections, create routes, or infer heading IDs. ## Responsive layout and images Check the contents list when the layout becomes one column. Wide code and tables need their own overflow handling. Images in the body need dimensions and descriptive alt text; avoid using screenshots as the only source of instructions. --- # FAQ Blocks for Astro Source: https://ui.gnosticai.com/blocks/faqs ## Split Keep the introduction beside the question list. ```astro --- import FaqBlock from "@/components/blocks/faqs/faqs-1.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/faqs-1 ``` ## Centered Center the introduction above the answers. ```astro --- import Faqs2Block from "@/components/blocks/faqs/faqs-2.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/faqs-2 ``` ## Grouped Group related questions so readers can find the right topic. ```astro --- import Faqs3Block from "@/components/blocks/faqs/faqs-3.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/faqs-3 ``` ## Compact Keep a short question list in a compact section. ```astro --- import Faqs4Block from "@/components/blocks/faqs/faqs-4.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/faqs-4 ``` ## Faqs Portfolio An independent section from the Portfolio template. Supply its content through props. ```astro --- import Block from "@/components/blocks/faqs/faqs-portfolio.astro" import asset0 from "../../../../../packages/templates/sable/site/src/assets/sable/salon-interior.png" const content = { title: "Before your visit.", description: "A few answers to help you choose an appointment.", questions: [ { question: "I am not sure which service to book.", answer: "Start with a consultation. Tell us what you would like to change and we can help you choose the right appointment.", }, { question: "Do you work with different hair textures?", answer: "The sample service menu includes cuts, curls, and texture care. Add your team’s specialties and consultation needs before publishing your site.", }, { question: "What do the starting prices include?", answer: "These are sample prices for this template. A salon can use this space to explain what is included and when a longer appointment costs more.", }, { question: "Can I ask for a quiet appointment?", answer: "Yes. Let us know when you get in touch. You can still ask questions at any point.", }, { question: "How do I book or change an appointment?", answer: "Use the contact details below. This demo has no live booking service; connect your own booking link before launch.", }, ], image: { src: asset0, alt: "Warm daylight across the chairs and mirrors at Sable", }, tags: ["Cuts", "Colour", "Styling"], contact: { label: "Plan your visit", href: "#visit", email: "hello@example.com", available: "Cuts · Colour · Care", }, } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/faqs-portfolio ``` ## Divided question list Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/faqs/faqs-divided-list/faqs-divided-list.astro" import type { DividedFaqsContent } from "@/components/blocks/faqs/faqs-divided-list/types" const content = { label: "Before we start", title: "Good Questions. Clear Answers.", description: "Have a workflow in mind?", button: { label: "Tell us about it", href: "/contact", }, questions: [ { title: "What should we automate first?", description: "Choose a task that repeats often, has clear inputs, and has a result you can check. Intake, status updates, and internal search are useful places to look. We map the work before recommending a tool.", }, { title: "Will this work with our current tools?", description: "We check the available APIs and permissions during discovery. Where a supported connection exists, we use it. If a tool has limits, we explain the options before we scope the build.", }, { title: "Where do people stay in the process?", description: "You decide which actions need approval. We can prepare a draft, suggest a route, or flag a result while your team makes the final call. Each workflow also has an owner and a manual fallback.", }, { title: "What does a first project include?", description: "The pilot includes a discovery session, one defined workflow, testing, documentation, and launch support. We agree on the inputs, outputs, and success measure before work starts.", }, { title: "What happens after launch?", description: "We review the first runs with your team and hand over clear instructions. Ongoing care can cover failed runs, tool changes, usage reports, and agreed improvements as your needs change.", }, ], } satisfies DividedFaqsContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/faqs-divided-list ``` ## Editorial faqs Use this section for the faqs part of a studio site. ```astro --- import Section from "@/components/blocks/faqs/faqs-agency.astro" const section = { label: "Before we begin", title: "A little", accent: "more detail", faqs: [ { question: "Who is Foldline designed to work with?", answer: "Our focus is architecture practices, interior design studios, furniture makers, and considered places to stay. The work can begin with a new studio or an established team ready for a clearer story.", }, { question: "How much time should we allow?", answer: "A focused identity usually needs four to six weeks. A complete brand and website often needs eight to twelve. We agree on the scope, content needs, and review dates before starting.", }, { question: "Can we keep our current identity?", answer: "Yes. A website can build on the identity you already have. We review the parts that work, fill any gaps, and set a clear direction for the digital experience.", }, { question: "Will we be able to add new projects ourselves?", answer: "Yes. We set up a clear editing structure and walk your team through it. You can add photographs, project notes, and new pages without changing the design system.", }, { question: "What should we bring to the first conversation?", answer: "A short note about your practice, a few recent projects, and what you want to change is enough. If you have a target launch date or budget range, include that too.", }, ], } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/faqs-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Home services faqs ```astro --- import Block from "@/components/blocks/faqs/faqs-remodify.astro" const content = { eyebrow: "Plan With Confidence", title: "Good Questions.", description: "Practical answers before you start a home remodel.", questions: [ { title: "Which remodeling projects can you help with?", description: "We focus on kitchens, bathrooms, whole-home renovations, and interior updates. Share your goals and photos of the space so we can discuss whether the project is a good fit.", }, { title: "Do you work outside Raleigh?", description: "Our sample service area includes Cary, Apex, Morrisville, Garner, Wake Forest, Holly Springs, and Knightdale. Send your address with your inquiry so the team can confirm availability.", }, { title: "What should I prepare for the first conversation?", description: "Bring a short list of what works, what does not, and what you want to change. Photos, rough dimensions, inspiration images, a budget range, and your preferred start date are useful.", }, { title: "How much does a home remodel cost?", description: "Cost depends on the size of the space, materials, layout changes, and the condition of the home. A site review and written scope help produce an estimate you can assess. Ask which allowances and exclusions are included.", }, { title: "How long does a kitchen or bathroom remodel take?", description: "Design decisions, permits, material lead times, and the work itself all affect the schedule. The project plan should separate preparation from construction and identify any periods when a room cannot be used.", }, { title: "Can I stay at home during the renovation?", description: "It depends on the work and access to essential rooms. Discuss dust control, work hours, pets, temporary cooking arrangements, and bathroom access before the start date. Some projects need temporary accommodation.", }, { title: "Who handles permits and inspections?", description: "Permit needs depend on the work and the local authority. Confirm permit applications, inspections, and related fees in the written scope. Ask who is responsible for each step before work begins.", }, { title: "What happens if I want to change the plan?", description: "Ask for a written change order that explains the new work, cost, and schedule. Approve the change before it proceeds so both sides have the same record.", }, ], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/faqs-remodify ``` ## Choose a faqs layout Choose an FAQ block for specific questions that remain after the main explanation. Keep essential pricing or service terms in visible page content as well. ## Pass content from Astro Pass stable IDs, questions, and answers in the faqs array. Use the optional buttons for support or further details. The block receives content; it does not generate answers or add a support service. ## Responsive layout and images Check long questions, expanded answers, and keyboard use on a phone. Disclosure controls need visible focus and a usable target size. These sections are primarily text; images inside answers should explain a step and fit the panel width. ## Compose the next section Place the FAQ near [Pricing](/blocks/pricing), [Services](/blocks/services), or [Contact](/blocks/contact) according to the questions it resolves. --- # Features Blocks for Astro Source: https://ui.gnosticai.com/blocks/features ## Icon grid Pair each feature explanation with a small icon. ```astro --- import Features1Block from "@/components/blocks/features/features-1.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-1 ``` ## Cards Use cards to separate each feature and its supporting detail. ```astro --- import Features2Block from "@/components/blocks/features/features-2.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-2 ``` ## Media cards Give each feature a media area beside its explanation. ```astro --- import Features3Block from "@/components/blocks/features/features-3.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-3 ``` ## Horizontal scroll Show features or services in cards with an image at the top. Each card accepts a heading, description, optional highlights, and an optional action. The section uses [Horizontal Scroll](/components/horizontal-scroll) to move the cards as the page scrolls down. ```astro --- // @preview render=frame import FeaturesHorizontalScroll from "@/components/blocks/features/features-horizontal-scroll/features-horizontal-scroll.astro" import { horizontalScrollFeatures } from "./features-horizontal-scroll-data.ts" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-horizontal-scroll ``` Pass imported Astro images or image URLs through `features[].image`. The block renders them with Astro Image in a 16:9 frame. Supply alt text for meaningful images; the example illustrations are decorative and use empty alt text. Cards use a width of `24rem`, limited by the available space. Use `cardClass` to change their width. `top`, `speed`, `minWidth`, and `enabled` pass through to Horizontal Scroll. The default minimum width is `768` pixels. This preview sets `minWidth={0}` so the effect is visible at each preview width. On small screens, with reduced motion, or when the cards are too tall for the viewport, the cards use a vertical layout. The block accepts native section attributes and uses the selected project preset. ### FeaturesHorizontalScrollProps ### HorizontalScrollFeature ## Sticky sidebar Keep the introduction visible beside the feature collection. ```astro --- import Features4Block from "@/components/blocks/features/features-sticky-scroll.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-sticky-scroll ``` ## Arc scroll Keep the background still. Scroll the feature cards over it. Each card snaps to the center. Cards above and below the center move farther to the right along a curve. Set `arc.angle` for the card tilt in degrees and `arc.radius` for the circle radius in item widths. The default radius is `1`; a larger radius gives a flatter curve. Tilt does not control the path. Pass fixed content through the `image` slot. A `feature-0`, `feature-1`, or later slot can replace a default card with any content. ```astro --- import { Image } from "astro:assets" import FeaturesStickyArc from "@/components/blocks/features/features-sticky-arc/features-sticky-arc.astro" import coast from "@/assets/wizard/wizard-overlooking-water.png" --- A traveler beside a lake, with an island and mountains in the distance. ``` ```sh bunx --bun shadcn@latest add @gnostic/features-sticky-arc ``` ### FeaturesStickyArcProps ## Floating grid Place the feature grid inside an inset section. ```astro --- import Features5Block from "@/components/blocks/features/features-5.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-5 ``` ## Text grid Let headings and short descriptions carry the feature list. ```astro --- import Features6Block from "@/components/blocks/features/features-6.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-6 ``` ### Image Tabs ```package-install bunx --bun shadcn@latest add @gnostic/image-tabs ``` Each tab shows a different image next to its copy. Pass Astro `Image` through a named slot such as `image-design` (from the tab title `Design`; spaces become hyphens) to replace the fallback `img`. Change the supporting image when a reader selects another tab. ```astro --- import { Image } from "astro:assets" import ImageTabs from "@/components/blocks/features/image-tabs/image-tabs.astro" import designImage from "@/assets/wizard/wizard-above-clouds.jpeg" import buildImage from "@/assets/wizard/wizard-on-moon.jpeg" import shipImage from "@/assets/wizard/wizard-in-field-looking-at-planet.png" const tabs = [ { title: "Design", description: "Shape the narrative first. Pair clear copy with a visual that matches the story you tell in each tab.", items: [ { title: "Layout system", description: "Keep columns, gaps, and type scale consistent across panels.", }, { title: "Visual hierarchy", description: "Lead with one idea, then support it with short detail cards.", }, ], image: { src: designImage.src, alt: "Wizard above the clouds", }, }, { title: "Build", description: "Wire each tab to a different image. Pass Astro Image through a named slot when you need optimization.", items: [ { title: "Shared tabs", description: "Uses the same Tabs primitives as the rest of the UI kit.", }, { title: "Image slots", description: "Override the fallback img with slot={`image-${value}`}.", }, ], image: { src: buildImage.src, alt: "Wizard on the moon", }, }, { title: "Ship", description: "Install the block, drop in your content, and keep media ownership in the consuming site.", items: [ { title: "Section shell", description: "Wraps content in Section and SectionContainer by default.", }, { title: "Reverse layout", description: "Set reverse to put the image column first on wide screens.", }, ], image: { src: shipImage.src, alt: "Wizard staff with glowing orb", }, }, ] --- Wizard above the clouds Wizard on the moon Wizard staff with glowing orb ``` ```sh bunx --bun shadcn@latest add @gnostic/image-tabs ``` ## Props ### ImageTabsProps ### ImageTab ## Alternating use cases Alternate images and descriptions in a sequence of use cases. ```astro --- import Block from "@/components/blocks/features/features-nimbus-use-cases.astro" const content = { eyebrow: "Daily routines", title: "Support for the small things.", description: "Show how a product fits into a normal day.", features: [ { eyebrow: "Morning", title: "Start with a clear table.", description: "Keep the breakfast area ready for the next task.", image: { src: "/images/nimbus-sample.svg", alt: "Product sample", }, note: "Ready for the day", }, { eyebrow: "Evening", title: "Put the room back in order.", description: "Return everyday items to their usual places.", image: { src: "/images/nimbus-sample.svg", alt: "Product sample", }, note: "Time to rest", }, ], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-nimbus-use-cases ``` ## Materials and image grid Place product specifications beside a sticky image grid. ```astro --- import Block from "@/components/blocks/features/features-nimbus-materials.astro" const content = { eyebrow: "Materials", title: "Made for daily use.", description: "Describe the surface, care requirements, and available finishes.", tags: ["Matte finish", "Modular panels", "Sample colours"], specifications: [ { label: "Shell", value: "Coated panel", }, { label: "Care", value: "Wipe with a soft cloth", }, ], gallery: [ { src: "/images/nimbus-sample.svg", alt: "Product sample", }, { src: "/images/nimbus-sample.svg", alt: "Surface sample", }, { src: "/images/nimbus-sample.svg", alt: "Connector detail", }, { src: "/images/nimbus-sample.svg", alt: "Rear panel", }, ], note: "Use verified specifications for your product.", action: { label: "Request a sample", href: "https://example.com/samples", }, } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-nimbus-materials ``` ## Image and key specifications Pair a large image with a heading and key measurements. ```astro --- import Block from "@/components/blocks/features/features-nimbus-specification.astro" const content = { eyebrow: "Quick stats", title: "The details that matter.", description: "Put a few key measurements beside a full-height product image.", image: { src: "/images/nimbus-sample.svg", alt: "Product sample", }, metrics: [ { label: "Runtime", value: "18 h", description: "Example runtime for a normal day.", }, { label: "Setup", value: "30 min", description: "Example time to complete the initial setup.", }, ], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-nimbus-specification ``` ## Features Portfolio Process An independent section from the Portfolio template. Supply its content through props. ```astro --- import Block from "@/components/blocks/features/features-portfolio-process.astro" import asset0 from "../../../../../packages/templates/sable/site/src/assets/sable/stylist-at-work.png" const content = { eyebrow: "Your appointment", title: "From first hello\nto the final mirror check.", description: "A clear plan, enough time, and advice you can use at home.", image: { src: asset0, alt: "A stylist carefully drying a client’s hair", }, projectsLabel: "Explore the looks", steps: [ { title: "Tell us what you have in mind", description: "Share your routine, your inspiration, and anything you would like to change. We will discuss time and price before we start.", icon: "messages-square", }, { title: "Settle into the chair", description: "We shape, colour, or style with care. Ask questions, bring a book, or enjoy a quiet appointment.", icon: "scissors", }, { title: "Take the care home", description: "We finish with a mirror check and a few useful steps for keeping your hair feeling good between visits.", icon: "heart", }, ], contact: { label: "Plan your visit", href: "#visit", email: "hello@example.com", available: "Cuts · Colour · Care", }, projectsHref: "#looks", } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-portfolio-process ``` ## Process cards Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/features/features-process-cards/features-process-cards.astro" import type { ProcessCardsContent } from "@/components/blocks/features/features-process-cards/types" const content = { label: "The Gnotch method", title: "From a repeated task to a reliable system", steps: [ { title: "Map the work.", description: "We follow a real request from start to finish and find the steps worth automating.", label: "Step 1.", visual: "workflow", }, { title: "Build the connection.", description: "We connect your tools, add clear review points, and test with your team.", label: "Step 2.", visual: "integrations", }, { title: "Keep it useful.", description: "We check failed runs, improve the rules, and help your workflow adapt.", label: "Step 3.", visual: "updates", }, ], } satisfies ProcessCardsContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-process-cards ``` ## Icon feature grid Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/features/features-icon-bento/features-icon-bento.astro" import type { IconBentoContent } from "@/components/blocks/features/features-icon-bento/types" const content = { label: "Built for everyday work", title: "Small Connections. A Clearer Workday.", features: [ { title: "Time to focus.", description: "Keep repeated admin out of your best hours.", icon: "clock", }, { title: "A sensible scope.", description: "Start with the work that earns its place.", icon: "coins", }, { title: "Clear hand-offs.", description: "Give each request a next step and an owner.", icon: "zap", }, { title: "Useful signals.", description: "See what changed and what needs a decision.", icon: "chart", }, { title: "Human control.", description: "Review the actions that matter before they run.", icon: "target", }, { title: "Room to grow.", description: "Add the next workflow when the first one works.", icon: "layers", }, ], } satisfies IconBentoContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-icon-bento ``` ## Before and after Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/features/features-before-after/features-before-after.astro" import type { BeforeAfterContent } from "@/components/blocks/features/features-before-after/types" const content = { label: "A clearer way to work", title: "Less Chasing. More Moving Forward.", beforeTitle: "The busywork loop", afterTitle: "The Gnotch approach", rows: [ { before: "Copy the same details into three tools", after: "Capture once, pass the details on", }, { before: "Sort every request by hand", after: "Route requests with clear rules", }, { before: "Search through old messages", after: "Find answers in approved sources", }, { before: "Start every reply from scratch", after: "Review a draft with useful context", }, { before: "Chase the latest project update", after: "Open one shared morning brief", }, { before: "Miss a hand-off between teams", after: "Assign the next step and its owner", }, { before: "Discover errors after a complaint", after: "Flag failed runs for review", }, { before: "Add a new tool for each problem", after: "Connect the tools you already use", }, { before: "Trust an answer without context", after: "Check the source before you act", }, { before: "Rebuild everything at once", after: "Improve one workflow at a time", }, ], } satisfies BeforeAfterContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-before-after ``` ## Editorial process Use this section for the process part of a studio site. ```astro --- import Section from "@/components/blocks/process/process-agency.astro" const section = { label: "How we work", title: "From first sketch", accent: "to final detail", description: "Four clear stages, with time to look closely and make decisions together.", steps: [ { title: "Find the story", description: "We learn about your practice, your projects, and the people you want to reach. Together, we set a clear brief.", }, { title: "Shape the system", description: "We explore type, image, language, and structure. The strongest direction becomes a small, useful design system.", }, { title: "Build with care", description: "We turn the design into a fast, accessible site. Real project content helps us check every page and screen size.", }, { title: "Make it yours", description: "We prepare the launch, show your team how to publish, and stay close while the site finds its feet.", }, ], } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/process-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Home services process ```astro --- import Block from "@/components/blocks/features/features-remodify-process.astro" const content = { eyebrow: "From Idea to Everyday", title: "A Clear Path.", description: "Know what happens next, what needs your input, and how each step moves your remodel forward.", badge: "Planned together", trustTitle: "Your questions belong in the plan.", trustDescription: "We discuss costs, access, materials, and the effect on daily life before work starts.", supportLabel: "One contact from the first visit to the final check.", steps: [ { title: "Tell Us What Is Missing", description: "Walk us through your space, your daily routines, and your priorities. We discuss your budget and the changes that matter most.", image: { src: "https://images.unsplash.com/photo-1726090401458-7abb00f7450c?auto=format&fit=max&w=1600&q=80", alt: "Living room with timber beams and a stone fireplace", }, }, { title: "Make the Plan", description: "Review the layout, material choices, scope, and estimate. We identify permit needs and agree on the schedule before construction.", image: { src: "https://images.unsplash.com/photo-1762146828422-50a8bd416d3c?auto=format&fit=max&w=1600&q=80", alt: "Architectural drawings spread across a work surface", }, }, { title: "Bring It to Life", description: "We coordinate the work and keep you informed. Any change to the agreed scope is reviewed with you before it goes ahead.", image: { src: "https://images.unsplash.com/photo-1769353086138-19ee65291a04?auto=format&fit=max&w=1600&q=80", alt: "Carpenter shaping a piece of wood in a workshop", }, }, { title: "Settle Into Your Space", description: "Walk through the finished work together. We record any remaining items and share care details for your new finishes.", image: { src: "https://images.unsplash.com/photo-1696814543783-c0835c0be682?auto=format&fit=max&w=1600&q=80", alt: "Bright kitchen with white cabinets, wood flooring, and orange breakfast chairs", }, }, ], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/features-remodify-process ``` ## Choose a features layout Choose a grid when readers need to compare several features. Use a larger media layout when one feature needs an example or screenshot. Describe what the user can do rather than listing vague qualities. ## Pass content from Astro Pass the features array and heading props required by the chosen variant. Icon names must resolve to supported icons. Keep feature links meaningful and omit them when there is no useful destination. ## Responsive layout and images Check uneven description lengths and grid wrapping at narrow widths. Use screenshots that show the feature clearly and supply alt text for the relevant detail. Do not repeat the same decorative image in every card just to fill space. ## Compose the next section Use [Content](/blocks/content) for a deeper explanation and [Hero](/blocks/hero) to introduce the page’s main offer. --- # Footer Blocks for Astro Source: https://ui.gnosticai.com/blocks/footer ## Columns Group destinations into columns beside the site details. ```astro --- import Footer1Block from "@/components/blocks/footer/footer-1.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/footer-1 ``` ## Compact Keep the brand, links, and copyright in a compact footer. ```astro --- import Footer2Block from "@/components/blocks/footer/footer-2.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/footer-2 ``` ## Expanded Give a larger set of site links space to form clear groups. ```astro --- import Footer3Block from "@/components/blocks/footer/footer-3.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/footer-3 ``` ## Footer Portfolio An independent section from the Portfolio template. Supply its content through props. ```astro --- import Block from "@/components/blocks/footer/footer-portfolio.astro" const content = { title: "A good hair day starts with a conversation.", socials: [], copyright: "Sable. A fictional hair studio.", contact: { label: "Plan your visit", href: "#visit", email: "hello@example.com", available: "Cuts · Colour · Care", }, homeHref: "#top", } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/footer-portfolio ``` ## Large wordmark footer Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/footer/footer-large-wordmark/footer-large-wordmark.astro" import type { LargeWordmarkFooterContent } from "@/components/blocks/footer/footer-large-wordmark/types" const content = { name: "Gnotch", description: "AI systems for a clearer workday.", navigation: [ { label: "Home", href: "/", }, { label: "About", href: "/about", }, { label: "Journal", href: "/blog", }, { label: "Contact", href: "/contact", }, ], email: "hello@gnotch.example", phone: "+1 (212) 555-0148", hours: "Monday–Friday, 9 AM–5 PM ET", address: "New York · Working everywhere", newsletter: { title: "A useful note, once a month.", label: "Count me in", description: "Workflow ideas, field notes, and small ways to work better. Request the next issue by email.", email: "hello@gnotch.example", }, socials: [ { label: "LinkedIn", href: "https://example.com/gnotch/linkedin", }, { label: "YouTube", href: "https://example.com/gnotch/youtube", }, { label: "Instagram", href: "https://example.com/gnotch/instagram", }, { label: "GitHub", href: "https://example.com/gnotch/github", }, ], credit: { label: "© Gnotch Studio. Made for the next step.", href: "/", }, privacy: { label: "Privacy policy", href: "/legal-pages/privacy-policy", }, } satisfies LargeWordmarkFooterContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/footer-large-wordmark ``` ## Editorial footer Use this section for the footer part of a studio site. ```astro --- import Section from "@/components/blocks/footer/footer-agency.astro" const section = { location: "An independent digital studio\nArchitecture · Interiors · Objects", email: "hello@foldline.example", phone: "+1 (212) 555-0148", phoneHref: "tel:+12125550148", socials: [ { label: "Studio notes", href: "https://example.com/blogs", }, { label: "Selected work", href: "https://example.com/projects", }, { label: "Start a conversation", href: "https://example.com/contact", }, ], copyright: "© 2026 Foldline. Fictional studio · original concept work.", name: "foldline", logo: { src: "/media/foldline/foldline-mark.svg", alt: "", }, homeHref: "https://example.com/", navigation: [ { label: "Services", href: "https://example.com/#service", }, { label: "Studio", href: "https://example.com/about", }, { label: "Work", href: "https://example.com/projects", }, { label: "Journal", href: "https://example.com/blogs", }, { label: "Contact", href: "https://example.com/contact", }, ], } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/footer-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Home services footer ```astro --- import Block from "@/components/blocks/footer/footer-remodify.astro" const content = { name: "Remodify", description: "Thoughtful home remodeling in Raleigh, North Carolina.", navigation: [ { label: "About", href: "#about-us", }, { label: "Services", href: "#services", }, { label: "Process", href: "#workflow", }, { label: "Inspiration", href: "#work", }, { label: "Stories", href: "#testimonial", }, ], action: { label: "Plan Your Remodel", href: "#contact", }, email: "hello@remodify.example", phone: { label: "(919) 555-0142", href: "tel:+19195550142", }, address: "Raleigh, NC and nearby Triangle communities", copyright: "© 2026 Remodify. All rights reserved.", socials: [], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/footer-remodify ``` ## Choose a footer layout Choose the footer from the amount of secondary navigation the site needs. Group links by a topic readers can recognize and keep important contact routes easy to find. ## Pass content from Astro Pass brand data, columns of links, optional social links, and copyright text. Keep dates and destinations in the template’s content data so repeated footer use stays consistent. ## Responsive layout and images Check column order when the footer stacks on a phone. Long labels should wrap without overlapping. Logo assets need a readable light and dark treatment; social icons still need link names. ## Compose the next section Pair the footer with the [Header](/blocks/header) and use [Links](/blocks/links) for a dedicated resource directory. --- # Gallery Blocks for Astro Source: https://ui.gnosticai.com/blocks/gallery ## Projects carousel Browse project images with captions and carousel controls. ```astro --- import ProjectsCarousel from "@/components/blocks/gallery/projects-carousel.astro" import cove from "@/assets/wizard/wizard-in-cove.png" import moon from "@/assets/wizard/wizard-on-moon.jpeg" import clouds from "@/assets/wizard/wizard-above-clouds.jpeg" import spaceship from "@/assets/wizard/wizard-spaceship.png" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/projects-carousel ``` The selected project appears at full size with its title, description, and link. Side images are smaller and dimmed. Select a side image, use the arrow buttons, or use the dots below the images. The dots sit on the right. Pass a `slides` array. Each slide has `title`, `description`, `href`, `button`, and `image`. The image has `src` and `alt`. Its source can be a string or an imported Astro image. String sources can also supply `width` and `height`. Set `label` to give the carousel an accessible name. An empty array renders no block. One project renders at full width without navigation controls. Image dimensions and the square frame keep the layout stable while images load. ## Hover gallery An evenly spaced grid of images, where each image grows on hover (or focus on mobile). ```astro --- import HoverGallery from "@/components/blocks/gallery/hover-gallery.astro" import wizardSmallStreet from "@/assets/wizard/wizard-small-street.png" import thePortal from "@/assets/images/the-portal.png" import beachAlien from "@/assets/images/beach-on-alien-planet.png" import cloudsPlate from "@/assets/wizard/wizard-above-clouds.png" import entranceHall from "@/assets/images/entrance-hall.png" import wizardLookingShip from "@/assets/wizard/wizard-looking-at-spaceship.png" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hover-gallery ``` ## Gallery Portfolio An independent section from the Portfolio template. Supply its content through props. ```astro --- import Block from "@/components/blocks/gallery/gallery-portfolio.astro" import asset0 from "../../../../../packages/templates/sable/site/src/assets/sable/salon-interior.png" import asset1 from "../../../../../packages/templates/sable/site/src/assets/sable/sculpted-bob.png" import asset2 from "../../../../../packages/templates/sable/site/src/assets/sable/natural-curls.png" import asset3 from "../../../../../packages/templates/sable/site/src/assets/sable/soft-balayage.png" import asset4 from "../../../../../packages/templates/sable/site/src/assets/sable/textured-crop.png" import asset5 from "../../../../../packages/templates/sable/site/src/assets/sable/silver-pixie.png" import asset6 from "../../../../../packages/templates/sable/site/src/assets/sable/loose-waves.png" const content = { title: "Find your next look", projectsLabel: "Ask about a look", portrait: { title: "Inside the studio", image: { src: asset0, alt: "Sable studio with pale oak workstations and warm neutral chairs", }, }, projects: [ { src: asset1, alt: "A chin-length dark bob with a soft fringe", name: "The sculpted bob", href: "#visit", label: "The sculpted bob", }, { src: asset2, alt: "Shoulder-length natural curls in soft daylight", name: "Natural curls", href: "#visit", label: "Natural curls", }, { src: asset3, alt: "Long brunette hair with subtle caramel colour", name: "Soft balayage", href: "#visit", label: "Soft balayage", }, { src: asset4, alt: "A short coily crop with a soft taper", name: "The textured crop", href: "#visit", label: "The textured crop", }, { src: asset5, alt: "A textured silver pixie cut", name: "Silver, softly shaped", href: "#visit", label: "Silver, softly shaped", }, { src: asset6, alt: "Shoulder-length dark waves with a soft face frame", name: "Everyday waves", href: "#visit", label: "Everyday waves", }, ], contact: { label: "Plan your visit", href: "#visit", email: "hello@example.com", available: "Cuts · Colour · Care", }, projectsHref: "#visit", aboutHref: "#studio", } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/gallery-portfolio ``` ## Editorial projects Use this section for the projects part of a studio site. ```astro --- import Section from "@/components/blocks/portfolio/portfolio-agency.astro" const section = { label: "Selected concept work", title: "Spaces with", accent: "a point of view", projects: [ { title: "Rook & Stone", description: "A quiet identity and project archive for a residential architecture practice.", image: { src: "/media/foldline/rook-stone.webp", alt: "Limestone courtyard house with an olive tree and reflecting pool", }, tags: ["Brand strategy", "Studio website"], awards: [ { title: "A clear point of view", description: "Brand foundations", }, { title: "Room for each project", description: "Editorial archive", }, ], href: "https://example.com/projects/rook-and-stone", }, { title: "Morrow Rooms", description: "A warm digital welcome for a collection of small, considered places to stay.", image: { src: "/media/foldline/morrow-rooms.webp", alt: "Warm guesthouse lounge with linen seating, walnut furniture, and soft window light", }, tags: ["Art direction", "Website design"], awards: [ { title: "An inviting first visit", description: "Guest experience", }, { title: "A sense of place", description: "Visual direction", }, ], href: "https://example.com/projects/morrow-rooms", }, { title: "Tern Objects", description: "An editorial collection for furniture made with a clear purpose and a lasting form.", image: { src: "/media/foldline/tern-objects.webp", alt: "Sculptural walnut chair and cylindrical oak table in a sunlit gallery", }, tags: ["Visual identity", "Collection design"], awards: [ { title: "Materials in focus", description: "Product storytelling", }, { title: "A useful collection", description: "Digital catalogue", }, ], href: "https://example.com/projects/tern-objects", }, ], action: { label: "Explore the projects", href: "https://example.com/projects", }, } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/portfolio-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Home services projects ```astro --- import Block from "@/components/blocks/gallery/gallery-remodify.astro" const content = { eyebrow: "Ideas for Your Remodel", title: "Better Living.", note: "[ Design inspiration. Stock photography. ]", projects: [ { title: "A Kitchen for Gathering", label: "Kitchen inspiration", details: ["Generous work surfaces", "Storage that earns its space"], image: { src: "https://images.unsplash.com/photo-1696814543783-c0835c0be682?auto=format&fit=max&w=1600&q=80", alt: "Bright kitchen with white cabinets, wood flooring, and orange breakfast chairs", }, }, { title: "A Calmer Morning Routine", label: "Bathroom inspiration", details: ["Natural light", "Simple, considered finishes"], image: { src: "https://images.unsplash.com/photo-1729173078273-3ee243b9273b?auto=format&fit=max&w=1600&q=80", alt: "Bathroom with a blue bathtub and a large window", }, }, { title: "Room to Be Together", label: "Whole-home inspiration", details: ["Connected spaces", "A warm, consistent palette"], image: { src: "https://images.unsplash.com/photo-1771888703723-01d85da1dae1?auto=format&fit=max&w=1600&q=80", alt: "Open living space with neutral sofas and curved chairs", }, }, { title: "Character at Every Angle", label: "Exterior inspiration", details: ["Simple forms", "Contrasting finishes"], image: { src: "https://images.unsplash.com/photo-1770756051811-1612ac8bedfa?auto=format&fit=max&w=1600&q=80", alt: "White home with dark windows and glass garage doors", }, }, ], stats: [ { value: "Function", label: "Start with daily life", description: "Make each room work harder.", }, { value: "Comfort", label: "Choose what feels right", description: "Build around your routines.", }, { value: "Character", label: "Keep what makes it yours", description: "Let your home feel like home.", }, ], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/gallery-remodify ``` ## Case study carousel Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/content/content-case-carousel/content-case-carousel.astro" import type { CaseCarouselContent } from "@/components/blocks/content/content-case-carousel/types" const content = { label: "Use cases", title: "What a Better Workday Could Look Like", cases: [ { title: "From first enquiry to a clear brief", description: "A service studio turns incoming requests into structured project briefs. Missing details get flagged before a person reviews the next step.", image: { src: "/media/gnotch/team-working.webp", alt: "Colleagues sharing ideas around a work table", }, label: "Fieldnote", }, { title: "A support queue with less guesswork", description: "A support team groups requests by topic, finds the right guide, and prepares a draft. People handle the decisions and the difficult conversations.", image: { src: "/media/gnotch/desk-session.webp", alt: "Colleagues reviewing a task at a laptop", }, label: "Northline", }, { title: "The daily update, already prepared", description: "An operations team brings project status, open tasks, and blockers into one morning brief. No more chasing five tools before the first meeting.", image: { src: "/media/gnotch/project-review.webp", alt: "A project discussion around an office table", }, label: "Plainwork", }, ], } satisfies CaseCarouselContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-case-carousel ``` ## Image carousel Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/content/content-image-carousel/content-image-carousel.astro" import type { ImageCarouselContent } from "@/components/blocks/content/content-image-carousel/types" const content = { label: "Inside the studio", title: "Shared Notes. Good Questions. Better Work.", images: [ { src: "/media/gnotch/workshop.webp", alt: "A small group working together with laptops", }, { src: "/media/gnotch/desk-session.webp", alt: "Colleagues reviewing a task at a laptop", }, { src: "/media/gnotch/team-working.webp", alt: "Colleagues sharing ideas around a work table", }, { src: "/media/gnotch/project-review.webp", alt: "A project discussion around an office table", }, ], } satisfies ImageCarouselContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-image-carousel ``` ## Make your own layout The block uses [Carousel](/components/carousel) with `variant="parallax"`. Use the base carousel's `image` and `overlay` slots when you need your own caption layout. Use only the `image` slot for an image gallery. The base carousel supplies the effect, selected state, and dot navigation. ## Responsive layout and images Each slide uses 70% of the carousel width in a narrow container. In a wide container, each slide uses half the width. One project always uses the full width. Keep titles and descriptions short so they fit over the image on mobile. Images fill a square frame and crop to fit. Use images whose subject stays visible in a square crop. Supply useful `alt` text and image dimensions. Imported Astro images supply their dimensions automatically. --- # Header Blocks for Astro Source: https://ui.gnosticai.com/blocks/header Header blocks render their default slot once, in the desktop actions area. Use `slot="mobile"` for actions that should appear inside the mobile menu. Navigation items are rendered as real links in both layouts. Set `mobileMenu="drawer"` to use the [Mobile Menu](/blocks/mobile-menu) drawer in any header. It includes child links, actions, and the mobile slot. The default is `mobileMenu="sheet"`. The drawer closes when the viewport reaches the desktop breakpoint at `1024px`. ```astro Book a call Book a call ``` When updating an existing header, move or copy the intended mobile actions into the named slot. Keep element IDs unique between the two slots. :::note On desktop, use the resize handle to adjust the container width and expose the mobile menu. ::: ## Justified Navigation & Actions Balance the logo, main navigation, and the call to action. ```astro --- import HeaderJustifiedNavActions from "@/components/blocks/header/header-justified-nav-actions.astro" import Logo from "@/assets/gnostic-ai-logo.svg" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/header-justified-nav-actions ``` ## Centered navigation Balance the navigation with brand details and action links. ```astro --- import HeaderCenteredNavigation from "@/components/blocks/header/header-centered-navigation.astro" import Logo from "@/assets/gnostic-ai-logo.svg" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/header-centered-navigation ``` ## Compact navigation Keep a short navigation list beside the site actions. ```astro --- import HeaderCompactNavigation from "@/components/blocks/header/header-compact-navigation.astro" import Logo from "@/assets/gnostic-ai-logo.svg" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/header-compact-navigation ``` ## Media menu Add supporting media and descriptions to a navigation panel. ```astro --- import HeaderMediaMenu from "@/components/blocks/header/header-media-menu.astro" import Logo from "@/assets/gnostic-ai-logo.svg" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/header-media-menu ``` ## Multi column menu Group related destinations into separate menu columns. ```astro --- import HeaderMultiColumnMenu from "@/components/blocks/header/header-multi-column-menu.astro" import Logo from "@/assets/gnostic-ai-logo.svg" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/header-multi-column-menu ``` ## Expandable Expand the compact header to reveal the full navigation. ```astro --- import HeaderExpandable from "@/components/blocks/header/header-expandable.astro" import Logo from "@/assets/gnostic-ai-logo.svg" --- {/* The bar is fixed. This box keeps that bar inside the preview. */}
``` ```sh bunx --bun shadcn@latest add @gnostic/header-expandable ``` ## Props ### HeaderProps ### HeaderLogo ### HeaderNavigationItem ### HeaderNavigationLink ### HeaderNavigationImage ### HeaderAction ## Header Portfolio An independent section from the Portfolio template. Supply its content through props. ```astro --- import Block from "@/components/blocks/header/header-portfolio.astro" const content = { brand: "Sable", contact: { label: "Plan your visit", href: "#visit", email: "hello@example.com", available: "Cuts · Colour · Care", }, navigation: [ { label: "Services", href: "#services", }, { label: "Looks", href: "#looks", }, { label: "The studio", href: "#studio", }, { label: "Visit", href: "#visit", }, ], homeHref: "#top", } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/header-portfolio ``` ## Centered brand mark Supply your own content. The section uses the selected project preset. ```astro --- // @preview render=frame import Block from "@/components/blocks/header/header-centered-mark/header-centered-mark.astro" import type { CenteredMarkHeaderContent } from "@/components/blocks/header/header-centered-mark/types" const content = { name: "Gnotch", href: "/", navigation: [ { label: "Home", href: "/", }, { label: "About", href: "/about", }, { label: "Journal", href: "/blog", }, { label: "Contact", href: "/contact", }, ], } satisfies CenteredMarkHeaderContent ---
``` ```sh bunx --bun shadcn@latest add @gnostic/header-centered-mark ``` ## Editorial header Use this section for desktop navigation and a mobile menu. ```astro --- import Section from "@/components/blocks/header/header-agency.astro" const section = { name: "foldline", description: "A digital design studio for architecture, interiors, and objects. Brand identities, websites, and project stories with care in every detail.", colorMode: "dark", logo: { src: "/media/foldline/foldline-mark.svg", alt: "", }, navigation: [ { label: "Services", href: "https://example.com/#service", }, { label: "Studio", href: "https://example.com/about", }, { label: "Work", href: "https://example.com/projects", }, { label: "Journal", href: "https://example.com/blogs", }, { label: "Contact", href: "https://example.com/contact", }, ], action: { label: "Let’s talk", href: "https://example.com/contact", }, footer: { location: "An independent digital studio\nArchitecture · Interiors · Objects", email: "hello@foldline.example", phone: "+1 (212) 555-0148", phoneHref: "tel:+12125550148", socials: [ { label: "Studio notes", href: "https://example.com/blogs", }, { label: "Selected work", href: "https://example.com/projects", }, { label: "Start a conversation", href: "https://example.com/contact", }, ], copyright: "© 2026 Foldline. Fictional studio · original concept work.", }, homeHref: "https://example.com/", } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/header-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Home services header ```astro --- import Block from "@/components/blocks/header/header-remodify.astro" const content = { name: "Remodify", description: "Thoughtful home remodeling in Raleigh, North Carolina.", navigation: [ { label: "About", href: "#about-us", }, { label: "Services", href: "#services", }, { label: "Process", href: "#workflow", }, { label: "Inspiration", href: "#work", }, { label: "Stories", href: "#testimonial", }, ], action: { label: "Plan Your Remodel", href: "#contact", }, email: "hello@remodify.example", phone: { label: "(919) 555-0142", href: "tel:+19195550142", }, address: "Raleigh, NC and nearby Triangle communities", copyright: "© 2026 Remodify. All rights reserved.", socials: [], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/header-remodify ``` ## Choose a header layout Choose a header based on logo width, primary links, and the main action. A small site can use direct links; a larger one can use grouped navigation. ## Pass content from Astro Pass logo, navigation, and actions to the selected block. Some variants support a sheet or drawer mobile menu. Use real hrefs and keep link labels consistent between desktop and mobile views. ## Responsive layout and images Test the width at which the navigation changes layout with actual labels. Open and close the mobile menu with a keyboard and confirm focus returns to its trigger. Supply separate logo artwork for light and dark mode when the mark needs it. ## Compose the next section Use [Mobile Menu](/blocks/mobile-menu) for a separate compact navigation composition and [Footer](/blocks/footer) for secondary links. --- # Hero Blocks for Astro Source: https://ui.gnosticai.com/blocks/hero ## Split image Introduce the page with text, actions, and a supporting image. ```astro --- import Hero1Block from "@/components/blocks/hero/hero-1.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-1 ``` ## Social proof Place example social proof before the main page introduction. ```astro --- import Hero2Block from "@/components/blocks/hero/hero-2.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-2 ``` ## Background Keep the introduction over a background media area. ```astro --- import Hero3Block from "@/components/blocks/hero/hero-3.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-3 ``` ## Full height Give the background hero more vertical space. ```astro --- import Hero4Block from "@/components/blocks/hero/hero-4.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-4 ``` ## Checklist Pair the introduction with a short feature checklist. ```astro --- import Hero5Block from "@/components/blocks/hero/hero-5.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-5 ``` ## Split proof Keep features and example social proof near the main message. ```astro --- import Hero6Block from "@/components/blocks/hero/hero-6.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-6 ``` ## Wide image Give the supporting image a wider column. ```astro --- import Hero7Block from "@/components/blocks/hero/hero-7.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-7 ``` ## Image led Let the image take more space than the introduction. ```astro --- import Hero8Block from "@/components/blocks/hero/hero-8.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-8 ``` ## Masked image Fade the background media behind the text area. ```astro --- import Hero9Block from "@/components/blocks/hero/hero-9.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-9 ``` ## Spread overlay Spread the title and actions over the background media. ```astro --- import Hero10Block from "@/components/blocks/hero/hero-10.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-10 ``` ## Centered overlay Center the introduction over the background media. ```astro --- import Hero11Block from "@/components/blocks/hero/hero-11.astro" import { agentAvatars } from "@/lib/agent-avatars" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-11 ``` ## Editorial bar Keep the introduction in a bordered bar above the image. ```astro --- import Hero12Block from "@/components/blocks/hero/hero-12.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-12 ``` ## Compact split Keep the text compact beside a larger image. ```astro --- import Hero13Block from "@/components/blocks/hero/hero-13.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-13 ``` ## Portfolio Introduce a portfolio with a short profile and project links. ```astro --- import Block from "@/components/blocks/hero/hero-portfolio.astro" const content = { eyebrow: "Sable · An independent hair studio", title: "Good hair.\nYour way.", description: "A considered cut. Colour that grows with you. A chair where you can settle in and be yourself.", action: "Plan your visit", projectsLabel: "Find your next look", scrollLabel: "find a little inspiration", contactHref: "#visit", projectsHref: "#looks", } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-portfolio ``` ## Page banner Use a page introduction with a bordered bar and supporting image. ```astro --- import PageHeroBlock from "@/components/blocks/hero/hero-full-image-2col.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-full-image-2col ``` ## Orbit hero Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/hero/hero-orbit/hero-orbit.astro" import type { OrbitHeroContent } from "@/components/blocks/hero/hero-orbit/types" const content = { label: "Meet Gnotch", announcement: "Your AI automation studio", title: "Less busywork. More room for what comes next.", description: "We build AI agents and connected workflows for busy service teams. Clear the queue, connect your tools, and give your people space to do their best work.", buttons: [ { label: "Find your first workflow", href: "/contact", }, { label: "Explore the possibilities", href: "#solutions", }, ], clients: ["Fieldnote", "NORTHLINE", "Plainwork", "COMMONPLACE"], } satisfies OrbitHeroContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-orbit ``` ## Centered page title Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/hero/hero-centered-page/hero-centered-page.astro" import type { CenteredPageHeroContent } from "@/components/blocks/hero/hero-centered-page/types" const content = { label: "Meet the studio", title: "Better Systems Start with the People Using Them", image: { src: "/media/gnotch/planning-session.webp", alt: "A team comparing notes in a shared workspace", }, caption: "A shared table. A clearer plan.", description: "Gnotch is an AI automation studio for service teams. We bring process design, engineering, and a careful eye for everyday friction to the same table.", stats: [ { value: "01", label: "Workflow at a time", }, { value: "03", label: "Steps from idea to use", }, { value: "100%", label: "Clear ownership", }, ], } satisfies CenteredPageHeroContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-centered-page ``` ## Editorial hero Use this section for the hero part of a studio site. Set `servicesHref` to the services section or page, such as `"#capabilities"` or `"/services"`. The template supplies `"/#service"`. If you change the section ID, change this value too. ```astro --- import Section from "@/components/blocks/hero/hero-agency/hero-agency.astro" const section = { title: "Space,", accent: "well told.", description: "We build identities, websites, and stories for people who shape the spaces around us.", action: { label: "Tell us your story", href: "https://example.com/contact", }, servicesHref: "https://example.com/#service", services: [ { label: "Brand foundations", href: "https://example.com/#service", }, { label: "Studio websites", href: "https://example.com/#service", }, { label: "Project stories", href: "https://example.com/#service", }, { label: "Launch support", href: "https://example.com/#service", }, ], featured: { title: "In focus", href: "https://example.com/projects/morrow-rooms", image: { src: "/media/foldline/morrow-rooms.webp", alt: "Warm guesthouse lounge with linen seating, walnut furniture, and soft window light", }, }, video: "/media/foldline/foldline-flow.mp4", clients: ["rook & stone", "morrow", "tern"], image: { src: "/media/foldline/fold-sculpture.svg", alt: "", }, } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/hero-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Editorial intro Use this section for the title of a secondary page. ```astro --- import Section from "@/components/blocks/hero/hero-agency-intro.astro" const section = { label: "Meet Foldline", title: "Close work.", accent: "Clear thinking.", } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/hero-agency-intro ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Home services hero ```astro --- import Block from "@/components/blocks/hero/hero-remodify.astro" import hero from "../../../../../packages/templates/remodify/site/src/assets/remodify/remodeled-home.png" const content = { eyebrow: "Home remodeling in Raleigh, NC", title: "Make Home Yours.", description: "Kitchen, bathroom, and whole-home remodeling in Raleigh. Thoughtful spaces for the way you live.", action: { label: "Plan Your Remodel", href: "#contact", }, background: { src: hero, alt: "Remodeled white home with a timber front door, covered porch, and landscaped garden", }, } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/hero-remodify ``` ## Choose a hero layout Choose a hero from the content you have. A short service page can use a title and two actions. A product page may need a screenshot that explains the product. Portfolio and editorial variants place more weight on the work or story. Use one clear page heading and make the first action describe the next step. ## Pass content from Astro The variants have different prop types. For example, Hero 1 accepts title, description, an optional badge, buttons, and an image object. Import the block shown in the Code tab and pass your data into those props. Keep route queries and collection access in the page. Change sample claims and links before using the block in a real site. ## Responsive layout and images Test the actual heading at a narrow width; a short demo title does not reveal every line-wrap problem. Buttons can wrap, but their reading order should remain clear. Hero 1 uses an Astro image with responsive widths and eager loading. Supply a local image import where ImageMetadata is required. Choose a crop that keeps the subject visible and write alt text for what the image adds to the page. ## Compose the next section Follow the hero with [Features](/blocks/features) that support its claim or [Content](/blocks/content) that explains the offer. Use [Reviews](/blocks/reviews) only for real evidence. A hero does not need an image when the image adds no useful information. --- # Links Blocks for Astro Source: https://ui.gnosticai.com/blocks/links ## Resource carousel Let readers browse a compact set of related destinations. ```astro --- import Links2Block from "@/components/blocks/links/links-2.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/links-2 ``` ## Choose a links layout Choose a links block for a curated set of resources, project links, or destinations. Group related entries and describe why each destination is useful. ## Pass content from Astro Pass the links array supported by the chosen variant. Use descriptive titles, accurate hrefs, and concise descriptions. Preview data is supplied by the page; the block does not scrape destination metadata. ## Responsive layout and images Check long URLs and titles at narrow widths. If a preview image is used, choose a small, relevant asset and avoid depending on it as the only link label. Check hover and keyboard focus separately. ## Compose the next section Use [Articles](/blocks/articles) for editorial content and [Services](/blocks/services) for an offer that needs more detail. --- # Logos Blocks for Astro Source: https://ui.gnosticai.com/blocks/logos ## Grid Show the supplied names in a static collection. ```astro --- import Logos1Block from "@/components/blocks/logos/logos-1.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/logos-1 ``` ## Marquee Move a longer set of supplied names through a logo rail. ```astro --- import Logos2Block from "@/components/blocks/logos/logos-2.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/logos-2 ``` ## Compact Use a compact collection when the surrounding page already gives the context. ```astro --- import Logos3Block from "@/components/blocks/logos/logos-3.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/logos-3 ``` ## Choose a logos layout Choose a static collection when readers need to recognize several brands at once. Use only relationships you can describe accurately in the heading or nearby text. ## Pass content from Astro Pass brand names and optional hrefs to the selected block. Confirm that each name resolves to the intended icon or supply the artwork required by a variant. The block does not verify a customer relationship. ## Responsive layout and images Check optical size across wide and square marks. A shared box size does not make every logo look equally large. Use assets that remain visible in dark mode and retain accessible names on links. ## Compose the next section Place logos near [Reviews](/blocks/reviews) for supporting evidence or [Hero](/blocks/hero) when the relationship helps explain the offer. --- # Mobile Menu Blocks for Astro Source: https://ui.gnosticai.com/blocks/mobile-menu This block uses the [Drawer](/components/drawer) component. Items with child links open a new drawer panel. Child links can contain more submenus. Swipe, press Escape, or select Back to return one level. Selecting a destination closes the full menu. A parent with an `href` keeps its destination under Overview. Omit `href` when a parent only groups related items. Its submenu uses `DrawerMenuGroup label` to show a styled group label instead of an Overview link. The footer contains the actions and the default slot. ## Navigation Show navigation groups inside the mobile menu panel. ```astro --- import MobileMenuBlock from "@/components/blocks/mobile-menu/mobile-menu-1.astro" ---
gnostic ui
``` ```sh bunx --bun shadcn@latest add @gnostic/mobile-menu-1 ``` Open Components, then Navigation to try two submenu levels. Components has an Overview link. Navigation has no destination and uses a group label. Each panel opens from the same edge. The default is the right edge; set `position="bottom"` to use bottom panels with swipe handles. ## Installation ```sh bunx --bun shadcn@latest add @gnostic/mobile-menu-1 ``` ## Header option All five [header blocks](/blocks/header) accept `mobileMenu="drawer"`. They use the same navigation data and pass `actions`, plus `slot="mobile"`, to this block. The default remains `mobileMenu="sheet"`. ```astro Support ``` The header hides the trigger at `1024px` and closes an open drawer at that width. ## Props ### MobileMenuProps ### MobileMenuLink ### MobileMenuNavigationItem ### MobileMenuButton The standalone block has no breakpoint restriction. Use `class="lg:hidden"` and `closeOnMedia="(min-width: 1024px)"` when you pair it with desktop navigation. Custom footer links can use `DrawerClose as="a"` to close on selection. Use `class={buttonVariants()}` when that control should look like a button. ## Choose a mobile menu layout Choose a mobile menu for navigation that does not fit the desktop header at smaller widths. Keep its destinations aligned with the desktop navigation. ## Pass content from Astro Pass navigation groups, optional actions, and trigger/title labels. Position and variant props change the panel layout. Use closeOnMedia where supported to close a panel when the page returns to a desktop layout. ## Responsive layout and images Test opening, Escape, link activation, and focus return with a keyboard. A menu with many links needs scrolling that leaves the close control reachable. Logo or icon artwork needs a text name when it is the only visible mark. ## Compose the next section Use [Header](/blocks/header) for the complete shell and [Sheet](/components/sheet) or [Drawer](/components/drawer) for lower-level panel composition. --- # Pricing Blocks for Astro Source: https://ui.gnosticai.com/blocks/pricing ## Plan cards Present each plan with its price, included features, and action. ```astro --- import Pricing1Block from "@/components/blocks/pricing/pricing-1.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/pricing-1 ``` ## Comparison Keep plan details aligned so readers can compare the offers. ```astro --- import Pricing2Block from "@/components/blocks/pricing/pricing-2.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/pricing-2 ``` ## Single offer Give one offer room for a complete feature list. ```astro --- import Pricing3Block from "@/components/blocks/pricing/pricing-3.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/pricing-3 ``` ## Project plans Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/pricing/pricing-plan-cards/pricing-plan-cards.astro" import type { PlanCardsContent } from "@/components/blocks/pricing/pricing-plan-cards/types" const content = { label: "Ways to work together", title: "Start Small. Build What Comes Next.", plans: [ { title: "First Workflow", price: "$2,500", period: "/project", description: "A focused pilot for one repeated task with a clear beginning and end.", button: { label: "Plan a pilot", href: "/contact?plan=pilot", }, features: [ "Workflow discovery session", "One workflow, up to 3 tools", "Human approval checkpoints", "Test runs with sample data", "Team guide and handover", "30-day launch support", ], }, { title: "Connected Operations", price: "$1,500", period: "/month", label: "Ongoing care", description: "Keep your workflows healthy and improve them as your team learns.", button: { label: "Discuss ongoing care", href: "/contact?plan=operations", }, features: [ "Workflow health checks", "Failed-run review and fixes", "One improvement each month", "Usage and outcome reporting", "Monthly planning session", "A named technical contact", ], }, { title: "Custom Systems", price: "Let’s talk", description: "A scoped engagement for teams with several connected processes.", button: { label: "Scope your system", href: "/contact?plan=custom", }, features: [ "Process and data discovery", "Custom agents and integrations", "Access and approval design", "Staged rollout with your team", "Documentation and training", "A support plan that fits", ], }, ], } satisfies PlanCardsContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/pricing-plan-cards ``` ## Editorial pricing Use this section for the pricing part of a studio site. ```astro --- import Section from "@/components/blocks/pricing/pricing-agency.astro" const section = { label: "Ways to work together", title: "A good fit,", accent: "from the start", description: "Clear scopes for independent studios. The figures below show how a typical engagement can be structured.", plans: [ { title: "Foundation", description: "For a new practice finding its voice", price: "$4,800+", period: "/ engagement", featured: false, features: [ "Positioning workshop", "Visual identity direction", "Type, color, and image guidance", "A practical brand guide", ], action: { label: "Discuss your studio", href: "https://example.com/contact", }, }, { title: "Studio launch", description: "For a complete identity and digital home", price: "$9,600+", period: "/ engagement", featured: true, features: [ "Brand foundations", "Custom studio website", "Project archive and editing tools", "Content planning and launch checks", "Team handover and training", ], action: { label: "Plan your launch", href: "https://example.com/contact", }, }, { title: "Ongoing care", description: "For a studio with more stories to tell", price: "Let’s plan", period: "/ partnership", featured: false, features: [ "New project stories", "Website improvements", "Campaign and press materials", "A dedicated monthly work plan", ], action: { label: "Build a partnership", href: "https://example.com/contact", }, }, ], } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/pricing-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Home services pricing ```astro --- import Block from "@/components/blocks/pricing/pricing-remodify.astro" const content = { eyebrow: "Plan the Investment", title: "Your Scope.", description: "Every home is different. Your written estimate will reflect the work, material choices, and site conditions for your remodel.", featureLabel: "What we plan together:", plans: [ { title: "One Room", price: "Focused", unit: "remodel", description: "A kitchen, bathroom, or interior update with a clear purpose.", features: [ "Review of your existing space", "Layout and finish options", "Written scope of work", "Itemized project estimate", "Material and fixture planning", "A schedule for your project", ], action: { label: "Discuss One Room", href: "#contact", }, }, { title: "Whole Home", price: "Connected", unit: "renovation", badge: "A joined-up plan", description: "A coordinated approach for several rooms or a full interior renovation.", features: [ "Room-by-room priorities", "A consistent material palette", "Phased work and access planning", "Permit requirements review", "Coordinated trade schedules", "Final walkthrough and care guidance", ], action: { label: "Plan a Larger Remodel", href: "#contact", }, }, ], } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/pricing-remodify ``` ## Choose a pricing layout Choose a pricing layout that lets readers compare the same facts across plans. Mark a featured plan only when there is a clear reason to recommend it. ## Pass content from Astro Pass plan names, amounts, currency, billing unit, features, and button links. Explain recurring charges and limits in the content. The block displays prices; it does not calculate totals, manage subscriptions, or implement checkout. ## Responsive layout and images Check how cards stack on a phone and keep plan names attached to their feature lists. Long currency values and translated billing units need extra space. Pricing usually needs clear text more than decorative imagery. ## Compose the next section Use [FAQs](/blocks/faqs) for common billing questions and [CTA](/blocks/cta) for a single next step after a comparison. --- # Product Blocks for Astro Source: https://ui.gnosticai.com/blocks/product ## Featured Keep a product image, price, description, and actions in one section. ```astro --- import Product1Block from "@/components/blocks/product/product-1.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/product-1 ``` ## Choose a product layout Choose a product block for one item or offer. Give the description enough detail to explain what the reader receives and use the note for a real condition or limitation. ## Pass content from Astro Pass the title, image, price object, note, and action links required by the variant. Product data and availability belong in the page or backend. The display does not add an item to a cart by itself. ## Responsive layout and images Check the product image crop, price wrapping, and action layout on a phone. Supply accurate alt text and an image size suited to the main product view. A detail image should show useful evidence about the item. ## Compose the next section Use [Products](/blocks/products) for a collection and [Content](/blocks/content) for additional specifications or usage detail. --- # Products Blocks for Astro Source: https://ui.gnosticai.com/blocks/products ## Image grid Show product images and short descriptions in a grid. ```astro --- import Products1Block from "@/components/blocks/products/products-1.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/products-1 ``` ## List Use a compact list when the product details need less media. ```astro --- import Products2Block from "@/components/blocks/products/products-2.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/products-2 ``` ## Price cards Make the price easy to compare across product cards. ```astro --- import Products3Block from "@/components/blocks/products/products-3.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/products-3 ``` ## Action row Add a collection action beside the product row. ```astro --- import Products4Block from "@/components/blocks/products/products-4.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/products-4 ``` ## Hover grid Use image-led cards with the block hover treatment. ```astro --- import Products5Block from "@/components/blocks/products/products-5.astro" import placeholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/products-5 ``` ## Choose a products layout Choose a products grid when readers need to scan several items before opening a detail view. Keep each item’s information consistent so comparison is possible. ## Pass content from Astro Pass the products array accepted by the chosen block. Format price and unit data consistently. Filtering, stock checks, and pagination are separate application concerns. ## Responsive layout and images Check grid wrapping with long product titles and varied images. Use thumbnail sources and a consistent crop policy. Where the variant exposes links, make each destination name clear without relying only on its image. ## Compose the next section Use [Product](/blocks/product) for item detail and [Pagination](/components/pagination) for collections split across routes. --- # Reviews Blocks for Astro Source: https://ui.gnosticai.com/blocks/reviews ## Cards Give each sample quote its own card and attribution. ```astro --- import Reviews1Block from "@/components/blocks/reviews/reviews-1.astro" import { agentAvatars } from "@/lib/agent-avatars" const day = 24 * 60 * 60 * 1000 const formatter = new Intl.RelativeTimeFormat("en", { numeric: "auto" }) /** Format a review timestamp. The block only receives the finished label. */ function dateLabel(timestamp: number) { const days = Math.round((timestamp - Date.now()) / day) return formatter.format(days, "day") } const reviews = [ { rating: 5, reviewText: "The assessment explained which seam needed attention. I could decide on the repair before leaving my bag.", authorImage: agentAvatars[0], authorName: "Leila Moreno", source: "google", dateLabel: dateLabel(Date.now() - 14 * day), }, { rating: 5, reviewText: "The collection note listed the completed work and the care steps I should follow at home.", authorImage: agentAvatars[1], authorName: "Owen Patel", source: "yelp", dateLabel: dateLabel(Date.now() - 30 * day), }, { rating: 4.5, reviewText: "I brought the loose parts to the visit. The studio checked the fastening before suggesting a replacement.", authorImage: agentAvatars[2], authorName: "Nadia Chen", source: "trustpilot", }, ] --- ``` ```sh bunx --bun shadcn@latest add @gnostic/reviews-1 ``` ## Featured Place one featured sample quote beside shorter quotes. ```astro --- import Reviews2Block from "@/components/blocks/reviews/reviews-2.astro" import { agentAvatars } from "@/lib/agent-avatars" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/reviews-2 ``` ## Grid Arrange sample quotes in a grid with their attributions. ```astro --- import Reviews3Block from "@/components/blocks/reviews/reviews-3.astro" import { agentAvatars } from "@/lib/agent-avatars" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/reviews-3 ``` ## Marquee Move sample review cards through the section. ```astro --- import Reviews4Block from "@/components/blocks/reviews/reviews-4.astro" import { agentAvatars } from "@/lib/agent-avatars" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/reviews-4 ``` ## Rows Use rows when each sample quote needs a wider reading area. ```astro --- import Reviews5Block from "@/components/blocks/reviews/reviews-5.astro" import { agentAvatars } from "@/lib/agent-avatars" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/reviews-5 ``` ## Reviews Portfolio An independent section from the Portfolio template. Supply its content through props. ```astro --- import Block from "@/components/blocks/reviews/reviews-portfolio.astro" import asset0 from "../../../../../packages/templates/sable/site/src/assets/sable/salon-interior.png" const content = { title: "Words from the chair", description: "Fictional reviews for this block example. Replace them with real feedback before publication.", image: { src: asset0, alt: "Warm daylight across the chairs and mirrors at Sable", }, reviews: [ { authorName: "Alex", role: "Example client", reviewText: "We talked through the cut first. I left with a shape I can style at home.", rating: 5, }, { authorName: "Sam", role: "Example client", reviewText: "A quiet appointment and helpful advice about my curls.", rating: 5, }, ], stats: [], contact: { label: "Plan your visit", href: "#visit", email: "hello@example.com", available: "Cuts · Colour · Care", }, servicesHref: "#services", } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/reviews-portfolio ``` ## Image review carousel Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/reviews/reviews-image-carousel/reviews-image-carousel.astro" import type { ImageReviewsContent } from "@/components/blocks/reviews/reviews-image-carousel/types" const content = { label: "Sample client stories", title: "A Little Less Friction. A Lot More Focus.", reviews: [ { authorName: "Avery Cole", role: "Operations lead, Fieldnote", reviewText: "We open the day with a clear brief. The team can talk about the work instead of finding the latest update.", rating: 5, source: "google", image: { src: "/media/gnotch/team-working.webp", alt: "Colleagues sharing ideas around a work table", }, }, { authorName: "Samira Lane", role: "Founder, Commonplace", reviewText: "Gnotch started with our intake form. One small change made the whole project hand-off easier to follow.", rating: 5, source: "yelp", image: { src: "/media/gnotch/planning-session.webp", alt: "A team comparing notes in a shared workspace", }, }, { authorName: "Rowan Ellis", role: "Support lead, Northline", reviewText: "The assistant prepares a reply and shows its sources. We can spend our time on the questions that need a person.", rating: 5, source: "trustpilot", image: { src: "/media/gnotch/desk-session.webp", alt: "Colleagues reviewing a task at a laptop", }, }, { authorName: "Casey Park", role: "Director, Plainwork", reviewText: "We know what runs, what failed, and who owns the next step. That clarity matters as much as the time saved.", rating: 5, source: "google", image: { src: "/media/gnotch/workshop.webp", alt: "A small group working together with laptops", }, }, { authorName: "Morgan Reed", role: "Studio lead, Daymark", reviewText: "The workflow fits the tools we already use. We did not need to rebuild the way our team works.", rating: 5, source: "yelp", image: { src: "/media/gnotch/project-review.webp", alt: "A project discussion around an office table", }, }, ], } satisfies ImageReviewsContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/reviews-image-carousel ``` ## Editorial reviews Use this section for the reviews part of a studio site. ```astro --- import Section from "@/components/blocks/reviews/reviews-agency.astro" const section = { label: "Illustrative client notes", title: "Good work starts", accent: "with a conversation", reviews: [ { rating: 5, reviewText: "“The new archive makes the thinking behind each home much easier to understand.”", authorName: "Leah Wren", role: "Principal, Rook & Stone · sample quote", authorImage: "/media/foldline/avatar-lw.svg", source: "google", }, { rating: 5, reviewText: "“The site has the same calm welcome we want a guest to feel at the door.”", authorName: "Owen Hart", role: "Founder, Morrow Rooms · sample quote", authorImage: "/media/foldline/avatar-oh.svg", source: "yelp", }, { rating: 5, reviewText: "“Our materials, proportions, and process finally feel part of one story.”", authorName: "Ada Bell", role: "Director, Tern Objects · sample quote", authorImage: "/media/foldline/avatar-ab.svg", source: "trustpilot", }, { rating: 5, reviewText: "“A close, thoughtful process that gave us space to make the right decisions.”", authorName: "Kit Arden", role: "Interior designer · sample quote", authorImage: "/media/foldline/avatar-ka.svg", source: "google", }, ], } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/reviews-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Home services reviews ```astro --- import Block from "@/components/blocks/reviews/reviews-remodify.astro" const content = { eyebrow: "The Homeowner Experience", title: "Home Stories.", note: "[ Illustrative reviews for this template ]", reviews: [ { authorName: "Jamie R.", role: "Sample kitchen review", reviewText: "The layout finally makes sense for our family. We have a place for everything, and room to cook together.", rating: 5, source: "google", }, { authorName: "Morgan T.", role: "Sample bathroom review", reviewText: "We could see the choices clearly before work began. The new bathroom feels calm, bright, and much easier to use.", rating: 5, source: "yelp", }, { authorName: "Casey L.", role: "Sample renovation review", reviewText: "Having one person to call helped us keep track of the details. Each stage felt clear and manageable.", rating: 5, source: "trustpilot", }, { authorName: "Alex P.", role: "Sample interior review", reviewText: "The built-in storage made a real difference. Our living room feels open without losing its character.", rating: 5, source: "google", }, { authorName: "Taylor S.", role: "Sample kitchen review", reviewText: "The team helped us decide where to spend and where to keep things simple. The result fits the way we live.", rating: 5, source: "yelp", }, { authorName: "Jordan K.", role: "Sample whole-home review", reviewText: "The rooms feel connected now. The finishes work together, and the home still feels like ours.", rating: 5, source: "trustpilot", }, ], promises: [ { title: "Room for Your Input", description: "Your priorities guide the work.", }, { title: "Clear Next Steps", description: "Know what is happening and why.", }, ], action: { label: "Start Your Home Story", href: "#contact", }, } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/reviews-remodify ``` ## Choose a reviews layout Choose a review layout that gives each quote enough room to be read. Use actual feedback and accurate attribution. A short specific quote is more useful than a generic claim. ## Pass content from Astro Pass each review with review text, the reviewer name, and a rating. Add a portrait when you have one. Pass `source` as an icon name, such as `google` or `yelp`, when you want the platform icon. Pass `dateLabel` when you want a date line. The layout shows that text as supplied and leaves the line out when it is empty. A Google review can pass the `relativeTime` string from the API. You can also format a timestamp in the page and pass the result. The block displays supplied reviews; it does not collect, verify, or moderate them. ## Responsive layout and images Check long quotes and attribution at narrow widths. Portrait images should have consistent crops, and a missing image needs a useful fallback. Keep the rating understandable in text where the stars alone are unclear. ## Compose the next section Use [Logos](/blocks/logos) for brand relationships and [CTA](/blocks/cta) after evidence that supports the next action. --- # Services Blocks for Astro Source: https://ui.gnosticai.com/blocks/services ## Image grid Pair each service with an image and a short explanation. ```astro --- import Services1Block from "@/components/blocks/services/services-1.astro" import PlaceholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/services-1 ``` ## Process Show the service steps in the order a customer will follow. ```astro --- import Services2Block from "@/components/blocks/services/services-2.astro" import PlaceholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/services-2 ``` ## Overlays Place the service message over its supporting image. ```astro --- import Services3Block from "@/components/blocks/services/services-3.astro" import PlaceholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/services-3 ``` ## Minimal cards Use simple cards when a title and short description explain the offer. ```astro --- import Services4Block from "@/components/blocks/services/services-4.astro" import PlaceholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/services-4 ``` ## Icon grid Give each service a small icon and a concise explanation. ```astro --- import Services5Block from "@/components/blocks/services/services-5.astro" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/services-5 ``` ## Sticky sidebar Keep the introduction beside the service cards as readers move down the section. ```astro --- import Services6Block from "@/components/blocks/services/services-6.astro" import PlaceholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/services-6 ``` ## Featured grid Give one service more space than the supporting offers. ```astro --- import Services7Block from "@/components/blocks/services/services-7.astro" import PlaceholderImage from "@/assets/placeholder.webp" --- ``` ```sh bunx --bun shadcn@latest add @gnostic/services-7 ``` ## Services Portfolio An independent section from the Portfolio template. Supply its content through props. ```astro --- import Block from "@/components/blocks/services/services-portfolio.astro" import asset0 from "../../../../../packages/templates/sable/site/src/assets/sable/salon-interior.png" const content = { eyebrow: "Time in the chair", title: "A fresh start,\nor a small change.", description: "Every appointment begins with a conversation about your hair, your routine, and what you want to feel when you leave.", image: { src: asset0, alt: "Warm daylight across the chairs and mirrors at Sable", }, tags: ["Cuts", "Colour", "Styling"], capabilities: [ "All textures welcome", "Consultation first", "Care you can keep up", ], projectsLabel: "Explore the looks", services: [ { title: "Cut & finish", description: "A shape that works with your texture, finished with simple styling advice.", icon: "scissors", price: "From $65", duration: "60 minutes", }, { title: "Colour & gloss", description: "A subtle refresh or a new direction. We plan the shade and upkeep together.", icon: "palette", price: "From $95", duration: "90 minutes", }, { title: "Curls & texture", description: "Shape, definition, and a routine that makes room for your natural movement.", icon: "waves", price: "From $80", duration: "75 minutes", }, { title: "Style & occasion", description: "A relaxed finish, a polished blow-dry, or a look for a day worth dressing up for.", icon: "sparkles", price: "From $45", duration: "45 minutes", }, ], contact: { label: "Plan your visit", href: "#visit", email: "hello@example.com", available: "Cuts · Colour · Care", }, projectsHref: "#looks", } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/services-portfolio ``` ## Visual service grid Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/services/services-visual-grid/services-visual-grid.astro" import type { VisualServicesContent } from "@/components/blocks/services/services-visual-grid/types" const content = { label: "What we build", title: "Practical AI for the Work That Slows You Down", services: [ { title: "Connected Workflows.", description: "Move requests, files, and updates between your tools without copying them by hand.", visual: "workflow", }, { title: "Focused AI Agents.", description: "Give research and document tasks to an agent with a clear job and clear limits.", visual: "agents", }, { title: "Voice Assistants.", description: "Handle routine call questions and booking requests, with a route to a real person.", visual: "voice", }, { title: "Thoughtful Follow-up.", description: "Prepare useful reminders and draft replies while your team controls what goes out.", visual: "marketing", }, { title: "Reports That Explain.", description: "Bring scattered numbers into a daily brief that shows what needs your attention.", visual: "analytics", }, { title: "Knowledge Assistants.", description: "Help people find answers in your approved guides, with sources they can check.", visual: "chat", }, ], } satisfies VisualServicesContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/services-visual-grid ``` ## Editorial services Use this section for the services part of a studio site. ```astro --- import Section from "@/components/blocks/services/services-agency.astro" const section = { label: "Made for spatial brands", title: "Good work,", accent: "clearly seen", description: "A considered identity, a useful website, and stories that let people see the care in your work.", services: [ { title: "Brand foundations", description: "Find the words, type, and visual language that make your practice feel like you.", image: { src: "/media/foldline/brand-foundations.svg", alt: "", }, }, { title: "Studio websites", description: "Give your projects room to breathe, with clear navigation and an archive you can manage.", image: { src: "/media/foldline/studio-websites.svg", alt: "", }, }, { title: "Project stories", description: "Bring drawings, photographs, and the thinking behind a space into one clear narrative.", image: { src: "/media/foldline/project-stories.svg", alt: "", }, }, { title: "Launch support", description: "Put the details in place, from a project announcement to the first visitor enquiry.", image: { src: "/media/foldline/launch-support.svg", alt: "", }, }, ], } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/services-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Editorial expertise Use this section for the expertise part of a studio site. ```astro --- import Section from "@/components/blocks/experience/experience-agency.astro" const section = { label: "Our focus", title: "Built around", accent: "your world", description: "Different disciplines, connected by a belief that the details deserve to be seen.", entries: [ { title: "Architecture", role: "Practices & project archives", period: "01 / Places", description: "Help people understand a building through its setting, its decisions, and the way it is used.", }, { title: "Interiors & hospitality", role: "Studios & places to stay", period: "02 / Spaces", description: "Translate atmosphere into a clear digital experience, with useful detail alongside the images.", }, { title: "Furniture & objects", role: "Makers & collections", period: "03 / Objects", description: "Bring form, material, and craft into focus for the people who specify and live with your work.", }, ], } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/experience-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Home services services ```astro --- import Block from "@/components/blocks/services/services-remodify.astro" const content = { eyebrow: "Remodeling Services", title: "Room to Grow.", note: "[ Your home. Your next chapter. ]", services: [ { title: "Kitchen Remodeling", description: "Create a kitchen that works for busy mornings and long dinners. Plan cabinets, countertops, lighting, and storage around how you cook and gather.", icon: "cooking-pot", }, { title: "Bathroom Remodeling", description: "Make daily routines easier with a better layout, practical storage, durable tile, and a shower or bath that suits your space.", icon: "bath", }, { title: "Whole-Home Renovations", description: "Bring disconnected rooms together. Coordinate flooring, finishes, lighting, and layout changes with one plan for your home.", icon: "house", }, { title: "Interior Updates", description: "Refresh the rooms you already enjoy with built-in storage, finish carpentry, new flooring, and carefully chosen fixtures.", icon: "ruler", }, ], action: { label: "Talk through your ideas: (919) 555-0142", href: "tel:+19195550142", }, } --- ``` ```sh bunx --bun shadcn@latest add @gnostic/services-remodify ``` ## Choose a services layout Choose a services layout that matches how clients decide. A short grid can summarize a few services, while a larger image-led section can explain an involved engagement. ## Pass content from Astro Pass service titles, descriptions, optional labels, links, and images supported by the variant. State the outcome and scope in the content. Keep contact destinations in the route data so they can change without editing the reusable block. ## Responsive layout and images Check the order when images and text stack on small screens. Use project imagery that demonstrates the service and select a crop that preserves the useful detail. Long service names must remain readable beside any action. ## Compose the next section Use [Content](/blocks/content) for the process, [Reviews](/blocks/reviews) for evidence, and [Contact](/blocks/contact) for the enquiry. --- # Team Blocks for Astro Source: https://ui.gnosticai.com/blocks/team Introduce the people behind your work. Pass names, roles, images, and links as content props. ## Team grid Supply your own content. The section uses the selected project preset. ```astro --- import Block from "@/components/blocks/content/content-team-grid/content-team-grid.astro" import type { TeamGridContent } from "@/components/blocks/content/content-team-grid/types" const content = { label: "The people behind the work", title: "A Small Team. A Shared Standard.", people: [ { title: "Jules Mercer", description: "Strategy & process", image: { src: "/media/gnotch/portrait-jules.webp", alt: "Portrait of a smiling man in a gray sweater", }, href: "/contact", }, { title: "Maya Chen", description: "Automation & delivery", image: { src: "/media/gnotch/portrait-maya.webp", alt: "Portrait of a smiling woman with her hair tied back", }, href: "/contact", }, { title: "Theo Bennett", description: "AI systems & engineering", image: { src: "/media/gnotch/portrait-theo.webp", alt: "Portrait of a man in a dark knit shirt", }, href: "/contact", }, ], } satisfies TeamGridContent --- ``` ```sh bunx --bun shadcn@latest add @gnostic/content-team-grid ``` ## Editorial team Use this section for the team part of a studio site. ```astro --- import Section from "@/components/blocks/team/team-agency.astro" const section = { label: "The studio", title: "Different skills.", accent: "Shared care.", members: [ { title: "Nora Vale", role: "Strategy & Studio Lead", department: "Direction", image: { src: "/media/foldline/nora-vale.webp", alt: "Generated portrait of Nora Vale, a fictional Foldline team member", }, }, { title: "Elias Rowe", role: "Design Director", department: "Identity", image: { src: "/media/foldline/elias-rowe.webp", alt: "Generated portrait of Elias Rowe, a fictional Foldline team member", }, }, { title: "Mina Park", role: "Editorial Designer", department: "Storytelling", image: { src: "/media/foldline/mina-park.webp", alt: "Generated portrait of Mina Park, a fictional Foldline team member", }, }, { title: "Samir Chen", role: "Creative Developer", department: "Development", image: { src: "/media/foldline/samir-chen.webp", alt: "Generated portrait of Samir Chen, a fictional Foldline team member", }, }, { title: "Jules Avery", role: "Producer & Client Partner", department: "Delivery", image: { src: "/media/foldline/jules-avery.webp", alt: "Generated portrait of Jules Avery, a fictional Foldline team member", }, }, ], } ---
``` ```sh bunx --bun shadcn@latest add @gnostic/team-agency ``` See [serif accent font setup](/docs/installation#serif-accent-fonts-for-editorial-blocks) when installing this section. ## Responsive layout and images Use consistent portrait crops and supply image dimensions. Check long names, roles, social links, and carousel controls in a narrow container. Keep focus indicators visible when using a keyboard. --- # UI components for Astro Source: https://ui.gnosticai.com/components Find a control for a task, a container for related content, or a part for page navigation. Each guide shows the Astro composition and the install command. The Preview and Code tabs use the same example file. Descriptive example names identify the feature each file demonstrates. ## Build a complete page Start with the controls and content parts your page needs. Use [blocks](/blocks) for complete sections and [templates](/templates) for route and layout examples. Keep content in Astro props and slots so a reusable section does not depend on one site's collection or URL structure. Read the [Credits](/docs/credits) for the project foundation and design sources. --- # Accordion for Astro Source: https://ui.gnosticai.com/components/accordion ```astro --- import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@/components/ui/accordion" --- How do I open a question with the keyboard? Use Tab to reach the question, then Enter or Space to open its answer. Can the section use my site colors? The section reads shared text, border, and focus colors from the active theme. How does the panel open? The panel uses its measured height for the transition. Reduced-motion settings shorten the animation. ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/accordion ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. Install the component packages: ```sh bun add @data-slot/accordion ``` #### src/components/ui/accordion/accordion-content.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, hidden = true, ...props } = Astro.props --- ``` #### src/components/ui/accordion/accordion-item.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> & { value: string disabled?: boolean } const { class: className, value, disabled, ...props } = Astro.props ---
``` #### src/components/ui/accordion/accordion-trigger.astro ```astro --- import type { HTMLAttributes } from "astro/types" import ChevronDownIcon from "@lucide/astro/icons/chevron-down" import { cn } from "cn" type Props = HTMLAttributes<"button"> const { class: className, type = "button", ...props } = Astro.props --- ``` #### src/components/ui/accordion/accordion.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import type { AccordionProps } from "./types.ts" type Props = HTMLAttributes<"div"> & AccordionProps const { class: className, multiple, defaultValue, disabled, orientation = "vertical", loopFocus, hiddenUntilFound, ...props } = Astro.props const serializedDefaultValue = Array.isArray(defaultValue) ? JSON.stringify(defaultValue) : defaultValue ---
``` #### src/components/ui/accordion/index.ts ```ts export { default as Accordion } from './accordion.astro' export { default as AccordionContent } from './accordion-content.astro' export { default as AccordionItem } from './accordion-item.astro' export { default as AccordionTrigger } from './accordion-trigger.astro' export type { AccordionProps } from './types.ts' ``` #### src/components/ui/accordion/types.ts ```ts import type { AccordionOptions } from '@data-slot/accordion' /** * Accordion configuration rendered as data attributes. */ export type AccordionProps = Pick< AccordionOptions, | 'multiple' | 'defaultValue' | 'disabled' | 'orientation' | 'loopFocus' | 'hiddenUntilFound' > ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```ts import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@/components/ui/accordion" ``` ```astro How do I open a question with the keyboard? Use Tab to reach the question, then Enter or Space to open its answer. ``` ## Composition Arrange the parts as shown for an `Accordion`: ```text Accordion ├── AccordionItem │ ├── AccordionTrigger │ └── AccordionContent └── AccordionItem ├── AccordionTrigger └── AccordionContent ``` ## Examples ### Multiple Add `multiple` when readers need to compare answers without closing the previous item. ```astro --- import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@/components/ui/accordion" --- Account Manage your profile, billing details, and email preferences. Security Update your password, passkeys, and sign-in methods. Notifications Choose which product updates and alerts you want to receive. ``` ### With Disabled Set `disabled` on an `AccordionItem` when its trigger must be unavailable. ```astro --- import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@/components/ui/accordion" --- Available item This item can be opened and closed normally. Disabled item This panel stays unavailable to keyboard and pointer interaction. Another item You can still interact with the other items in the list. ``` ### With Borders For this divided layout, put `border` on the root and `border-b last:border-b-0` on each item. The last item uses the root border as its lower edge. ```astro --- import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@/components/ui/accordion" --- Design system Keep styles, spacing, and behavior consistent across your UI. Accessibility Ensure controls are readable and keyboard friendly. Performance Only reveal the content people need when they need it. ``` ### In Card Wrap the `Accordion` in a `Card` component. ```astro --- import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@/components/ui/accordion" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" --- FAQ Do you offer support? Yes. Support is included for all active subscriptions. Can I cancel anytime? Yes. You can cancel your subscription whenever you want. Is there a free trial? A trial is available for eligible plans and new accounts. ``` ## API Reference ### AccordionProps See the [data-slot docs](https://github.com/bejamas/data-slot/blob/main/packages/accordion/README.md) for more information on interactivity. ### Events Dispatch these events on the accordion root. The root emits the outbound events. #### Outbound events | Event | Detail | | ------------------ | --------------------- | | `accordion:change` | `{ value: string[] }` | #### Inbound events | Event | Detail | | --------------- | ------------------------------- | | `accordion:set` | `{ value: string \| string[] }` | Read the [installed source](/r/accordion.json) for the complete prop types. ## When to use Accordion Group related questions with Accordion items. Give each trigger a clear question or topic and place its answer in the matching content part. Keep the item structure from the examples so the controller can connect each trigger to its panel. ## Keyboard and behavior The data-slot controller handles trigger activation and expanded state. Use real trigger buttons so Enter and Space work. Keep essential instructions outside closed panels when the user needs them to complete a form. Test keyboard movement when items are disabled or added dynamically. ## Theme and layout Borders separate items and the indicator rotates with `data-panel-open`. Panel height uses the controller variable, so long content can animate without a fixed height. Theme changes affect text, focus, and borders. Do not apply a second height animation to the content wrapper. --- # Alert for Astro Source: https://ui.gnosticai.com/components/alert ```astro --- import CircleAlert from "@lucide/astro/icons/circle-exclamation-point" import CircleCheck from "@lucide/astro/icons/circle-check" import Info from "@lucide/astro/icons/info" import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert" const messages = [ { variant: "default" as const, title: "Review window opens Monday", detail: "Add content notes to the project before the review starts.", icon: Info, }, { variant: "info" as const, title: "Preview link updated", detail: "Use the new link in the project summary to check the current pages.", icon: Info, }, { variant: "success" as const, title: "Content saved", detail: "Your page changes are ready for the next review.", icon: CircleCheck, }, { variant: "warning" as const, title: "Two images need descriptions", detail: "Add useful alt text before publishing the gallery.", icon: CircleAlert, }, { variant: "error" as const, title: "The draft could not be saved", detail: "Keep this page open and try again when the connection returns.", icon: CircleAlert, }, { variant: "destructive" as const, title: "The upload was rejected", detail: "Choose an image file smaller than the project limit.", icon: CircleAlert, }, ] ---
{messages.map(({ variant, title, detail, icon: Icon }) => ( ))}
``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/alert ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. No extra packages are required. #### src/components/ui/alert/alert-variants.ts ```ts import { cva, type VariantProps } from 'class-variance-authority' export type AlertVariants = VariantProps export const alertVariants = cva("relative grid w-full items-start gap-x-2 gap-y-0.5 rounded-xl border px-3.5 py-3 text-card-foreground text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*4)_1fr_auto] has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:gap-x-2 [&>svg]:h-lh [&>svg]:w-4 group/alert", { defaultVariants: { variant: 'default', }, variants: { variant: { destructive: "border-destructive/32 bg-destructive/4 [&>svg]:text-destructive", default: "bg-transparent dark:bg-input/32 [&>svg]:text-muted-foreground", error: 'border-destructive/32 bg-destructive/4 [&>svg]:text-destructive', info: 'border-info/32 bg-info/4 [&>svg]:text-info', success: 'border-success/32 bg-success/4 [&>svg]:text-success', warning: 'border-warning/32 bg-warning/4 [&>svg]:text-warning', }, }, }) ``` #### src/components/ui/alert/alert-action.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/alert/alert-description.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/alert/alert-title.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/alert/alert.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import type { AlertVariants } from "./alert-variants" import { alertVariants } from "./alert-variants" type Props = AlertVariants & HTMLAttributes<"div"> const { class: className, variant, ...props } = Astro.props --- ``` #### src/components/ui/alert/index.ts ```ts export { default as Alert } from "./alert.astro" export { default as AlertAction } from "./alert-action.astro" export { default as AlertTitle } from "./alert-title.astro" export { default as AlertDescription } from "./alert-description.astro" ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```ts import { Alert, AlertAction, AlertDescription, AlertTitle } from "@/components/ui/alert" ``` ```astro Content review is ready Three pages have updated copy. Review the changes before publishing. ``` ## Example Use `AlertAction` when the alert should include a secondary control such as a button. ```astro --- import { Alert, AlertAction, AlertDescription, AlertTitle, } from "@/components/ui/alert" import { Button } from "@/components/ui/button" --- Content review is ready Three page descriptions changed since the last review. ``` ## Composition Arrange the parts as shown for an `Alert`: ```text Alert ├── Icon ├── AlertTitle ├── AlertDescription └── AlertAction ``` ## Notes - Use `Alert` for inline feedback inside the page flow. - Use `variant="error"` for a failed action and `variant="warning"` for a condition that needs attention. `destructive` uses the selected preset's destructive recipe; `error` keeps the Gnostic status treatment. - For destructive confirmation flows, use [Alert Dialog](/components/alert-dialog) instead. ## API Reference Read the [installed source](/r/alert.json) for the complete prop types. ## When to use Alert Use an Alert near the content that needs attention. Put the main fact in `AlertTitle`, then put the cause or next step in `AlertDescription`. An optional icon is a direct child. Add `AlertAction` only when a short action helps the reader resolve the message. An Alert stays in the page layout; it is not a toast service. ## Keyboard and behavior The root has `role="alert"` by default. Reserve an interrupting announcement for an urgent change. For an ordinary static note, pass an appropriate role such as `role="note"`. The component has no dismissal or notification queue script. A button inside an alert keeps its native keyboard behavior. ## Theme and layout Choose `info`, `success`, `warning`, or `error` to match the message. `default` and `destructive` use the selected preset's recipes. Status variants keep their Gnostic treatment and use the shared semantic tokens. State the result in text as well as color. Shared semantic tokens control the border, icon, and tint in both color modes; the neutral variant suits general page guidance. --- # Alert Dialog for Astro Source: https://ui.gnosticai.com/components/alert-dialog ```astro --- import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog" --- Review draft removal Remove this draft? Removing this draft deletes its saved content. Export a copy first if you need to keep it. Cancel Remove draft ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/alert-dialog ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. Install the component packages: ```sh bun add @data-slot/alert-dialog ``` #### src/components/ui/alert-dialog/alert-dialog-action.astro ```astro --- import type { ComponentProps } from "astro/types" import { Button } from "../button" type Props = ComponentProps const { ...props } = Astro.props --- ``` #### src/components/ui/alert-dialog/alert-dialog-cancel.astro ```astro --- import type { ComponentProps } from "astro/types" import { Button } from "../button/index.ts" type Props = ComponentProps const { variant = "outline", ...props } = Astro.props --- ``` #### src/components/ui/alert-dialog/alert-dialog-content.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import AlertDialogOverlay from "./alert-dialog-overlay.astro" import AlertDialogPortal from "./alert-dialog-portal.astro" import type { AlertDialogContentProps } from "./types.ts" type Props = HTMLAttributes<"div"> & AlertDialogContentProps const { class: className, size = "default", style, ...props } = Astro.props --- ``` #### src/components/ui/alert-dialog/alert-dialog-description.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"p"> const { class: className, ...props } = Astro.props ---

``` #### src/components/ui/alert-dialog/alert-dialog-footer.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/alert-dialog/alert-dialog-header.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/alert-dialog/alert-dialog-media.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/alert-dialog/alert-dialog-overlay.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, style, ...props } = Astro.props --- ``` #### src/components/ui/alert-dialog/alert-dialog-portal.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/alert-dialog/alert-dialog-title.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"h2"> const { class: className, ...props } = Astro.props ---

``` #### src/components/ui/alert-dialog/alert-dialog-trigger.astro ```astro --- import type { ComponentProps } from "astro/types" import { Button } from "../button/index.ts" type Props = ComponentProps const { ...props } = Astro.props --- ``` #### src/components/ui/alert-dialog/alert-dialog.astro ```astro --- import type { HTMLAttributes } from "astro/types" import type { AlertDialogProps } from "./types.ts" type Props = HTMLAttributes<"div"> & AlertDialogProps const { class: className, defaultOpen, closeOnClickOutside, closeOnEscape, lockScroll, ...props } = Astro.props ---
``` #### src/components/ui/alert-dialog/index.ts ```ts export { default as AlertDialog } from './alert-dialog.astro' export { default as AlertDialogAction } from './alert-dialog-action.astro' export { default as AlertDialogCancel } from './alert-dialog-cancel.astro' export { default as AlertDialogContent } from './alert-dialog-content.astro' export { default as AlertDialogDescription } from './alert-dialog-description.astro' export { default as AlertDialogFooter } from './alert-dialog-footer.astro' export { default as AlertDialogHeader } from './alert-dialog-header.astro' export { default as AlertDialogMedia } from './alert-dialog-media.astro' export { default as AlertDialogOverlay } from './alert-dialog-overlay.astro' export { default as AlertDialogPortal } from './alert-dialog-portal.astro' export { default as AlertDialogTitle } from './alert-dialog-title.astro' export { default as AlertDialogTrigger } from './alert-dialog-trigger.astro' export type { AlertDialogProps, AlertDialogContentProps } from './types.ts' ``` #### src/components/ui/alert-dialog/types.ts ```ts import type { AlertDialogOptions } from '@data-slot/alert-dialog' /** * Alert dialog configuration rendered as data attributes. */ export type AlertDialogProps = Pick< AlertDialogOptions, 'defaultOpen' | 'closeOnClickOutside' | 'closeOnEscape' | 'lockScroll' > /** * Width of the alert dialog panel. */ export type AlertDialogContentProps = { /** * Panel width. * * @default "default" */ size?: 'default' | 'sm' } ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```ts import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog" ``` ```astro Review draft removal Remove this draft? Removing this draft deletes its saved content. Export a copy first if you need to keep it. Cancel Remove draft ``` ## Composition Arrange the parts as shown for an `AlertDialog`: ```text AlertDialog ├── AlertDialogTrigger └── AlertDialogContent ├── AlertDialogHeader │ ├── AlertDialogMedia │ ├── AlertDialogTitle │ └── AlertDialogDescription └── AlertDialogFooter ├── AlertDialogCancel └── AlertDialogAction ``` ## Notes - Use `AlertDialog` for irreversible or high-risk actions, not routine inline confirmations. - Keep `AlertDialogTitle` and `AlertDialogDescription` inside `AlertDialogContent` so screen readers announce the dialog context clearly. - Pair the destructive path with `AlertDialogAction` and the safe path with `AlertDialogCancel`. - Use `size="sm"` on `AlertDialogContent` for compact confirmations and `AlertDialogMedia` when the dialog needs an icon or visual cue. ## API Reference ### AlertDialogProps ### AlertDialogContentProps See the [data-slot docs](https://github.com/bejamas/data-slot/blob/main/packages/alert-dialog/README.md) for more information on interactivity. ### Events Dispatch these events on the alert dialog root. The root emits the outbound events. #### Outbound events | Event | Detail | | --------------------- | ------------------- | | `alert-dialog:change` | `{ open: boolean }` | #### Inbound events | Event | Detail | | ------------------ | ------------------- | | `alert-dialog:set` | `{ open: boolean }` | Read the [installed source](/r/alert-dialog.json) for the complete prop types. ## When to use Alert Dialog Use Alert Dialog before an action whose effect is hard to reverse. Put the specific result in the title and explanation. Keep the cancel control available and label the action with a verb such as “Remove project”. The action button alone does not perform the operation. ## Keyboard and behavior The existing alert-dialog controller manages modal focus and dismissal. Confirm that focus returns to the trigger after cancellation. Run the operation from your own form or script only after the user chooses the action. Test Escape and focus order in the finished page. ## Theme and layout The surface shares dialog colors, border, and footer spacing. Keep copy short enough to fit a narrow screen and allow it to wrap. Destructive button color is useful, but the wording must still explain the outcome without color. --- # Aspect Ratio for Astro Source: https://ui.gnosticai.com/components/aspect-ratio ```astro --- import { Image } from "astro:assets" import { AspectRatio } from "@/components/ui/aspect-ratio" import image from "@/assets/wizard/wizard-on-moon.jpeg" --- Sample landscape ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/aspect-ratio ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. No extra packages are required. #### src/components/ui/aspect-ratio/aspect-ratio.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import type { AspectRatioProps } from "./types.ts" /** Div attributes pass through. */ type Props = HTMLAttributes<"div"> & AspectRatioProps const { class: className, ratio, style: styleProp, ...props } = Astro.props if (!Number.isFinite(ratio) || ratio <= 0) { throw new RangeError("AspectRatio needs a finite ratio greater than zero.") } const style = typeof styleProp === "string" ? `--ratio: ${ratio}; ${styleProp}` : { "--ratio": ratio, ...(styleProp ? styleProp : {}), } ---
``` #### src/components/ui/aspect-ratio/index.ts ```ts export { default as AspectRatio } from './aspect-ratio.astro' export type { AspectRatioProps } from './types.ts' ``` #### src/components/ui/aspect-ratio/types.ts ```ts /** * Props for a box that keeps a fixed width-to-height ratio. * Div attributes such as `class` and `id` pass through on the component. */ export interface AspectRatioProps { /** * Width divided by height. * * Common values include `16 / 9`, `4 / 3`, `1`, `9 / 16`, and `21 / 9`. */ ratio: number } ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```ts import { AspectRatio } from "@/components/ui/aspect-ratio" ``` ```astro Landscape ``` Pass width divided by height. Common values are `16 / 9`, `4 / 3`, `1`, `9 / 16`, and `21 / 9`. ## Example ### Aspect Ratio with Toggle Group Pair the aspect ratio component with a toggle group to allow users to select different views of the same image. ```astro --- import { Image } from "astro:assets" import { AspectRatio } from "@/components/ui/aspect-ratio" import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group" import image from "@/assets/wizard/wizard-looking-out-of-cave.png" const ratios = { "16:9": 16 / 9, "4:3": 4 / 3, "1:1": 1, "9:16": 9 / 16, "21:9": 21 / 9, } as const ---
{Object.entries(ratios).map(([label]) => ( {label} ))}
Sample landscape
``` ## Notes - Set `ratio` to width divided by height. Portrait frames use values below `1`. - Give slotted media `size-full` and `object-cover` when it should fill the box. - The container is `position: relative` so absolutely positioned children can fill it. ## API Reference ### AspectRatioProps Read the [installed source](/r/aspect-ratio.json) for the complete prop types. ## When to use Aspect Ratio Use Aspect Ratio when width is fluid but height must follow a known proportion. It reserves space before images load and keeps grids aligned. ## Keyboard and behavior Aspect Ratio does not crop or scale content by itself. Pair it with `object-cover` or layout utilities on the child. ## Theme and layout The box inherits width from its parent. Constrain width with utilities such as `max-w-md` when a portrait frame should stay narrow. --- # Attachment for Astro Source: https://ui.gnosticai.com/components/attachment ```astro --- import FileText from "@lucide/astro/icons/file-text" import X from "@lucide/astro/icons/x" import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentMedia, AttachmentTitle, } from "@/components/ui/attachment" ---
sales-dashboard.pdf PDF · 2.4 MB
``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/attachment ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. No extra packages are required. #### src/components/ui/attachment/attachment-action.astro ```astro --- /** * Icon or text action on an attachment. Renders a ghost {@link Button} by default. */ import type { ComponentProps } from "astro/types" import { cn } from "cn" import { Button } from "../button/index.ts" import type { AttachmentActionProps } from "./types.ts" type Props = ComponentProps & AttachmentActionProps const { class: className, variant = "ghost", size = "icon-xs", ...props } = Astro.props --- ``` #### src/components/ui/attachment/attachment-actions.astro ```astro --- /** * Aligns one or more attachment actions at the end of the card. */ import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/attachment/attachment-content.astro ```astro --- /** * Groups the attachment title and description. */ import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/attachment/attachment-description.astro ```astro --- /** * Secondary metadata for an attachment, such as type, size, or status text. */ import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"span"> const { class: className, ...props } = Astro.props --- ``` #### src/components/ui/attachment/attachment-group.astro ```astro --- /** * Horizontally scrollable row of attachments with snap points and edge fade. */ import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/attachment/attachment-media.astro ```astro --- /** * Media slot for an icon, spinner, or image preview on an attachment. */ import type { HTMLAttributes } from "astro/types" import type { VariantProps } from "class-variance-authority" import { cn } from "cn" import { attachmentMediaVariants } from "./attachment-variants.ts" import type { AttachmentMediaProps } from "./types.ts" type Props = HTMLAttributes<"div"> & AttachmentMediaProps & VariantProps const { class: className, variant = "icon", ...props } = Astro.props ---
``` #### src/components/ui/attachment/attachment-title.astro ```astro --- /** * Primary label for an attachment, usually the file name. * Shimmers while the root attachment is uploading or processing. */ import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"span"> const { class: className, ...props } = Astro.props --- ``` #### src/components/ui/attachment/attachment-trigger.astro ```astro --- /** * Full-card control behind attachment actions. Use `as` for a link or other element. */ import type { HTMLAttributes } from "astro/types" import type { HTMLTag, Polymorphic } from "astro/types" import { cn } from "cn" type Props = Polymorphic<{ as: T }> & HTMLAttributes const { as: Tag = "href" in Astro.props ? "a" : "button", class: className, ...props } = Astro.props const elementProps: Record = { ...props } elementProps.type = Tag === "button" ? elementProps.type || "button" : undefined --- ``` #### src/components/ui/attachment/attachment-variants.ts ```ts import { cva } from 'class-variance-authority' /** Root attachment layout, size, and orientation recipes. */ export const attachmentVariants = cva("relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-2xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/30 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed group/attachment", { defaultVariants: { orientation: 'horizontal', size: 'default', }, variants: { orientation: { horizontal: "min-w-40 items-center", vertical: "w-24 has-data-[slot=attachment-content]:w-30 flex-col", }, size: { default: "gap-2 has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2 text-sm", sm: "gap-2.5 has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5 text-xs", xs: "gap-1.5 has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1 text-xs rounded-xl", }, }, }) /** Media slot recipes for icon and image attachments. */ export const attachmentMediaVariants = cva( "bg-muted text-foreground w-10 rounded-lg group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md [&_svg:not([class*='size-'])]:size-4 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5 group-data-[orientation=vertical]/attachment:w-full group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive relative flex aspect-square shrink-0 items-center justify-center overflow-hidden [&_svg]:pointer-events-none", { defaultVariants: { variant: 'icon', }, variants: { variant: { icon: '', image: "opacity-60 group-data-[state=idle]/attachment:opacity-100 group-data-[state=done]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover", }, }, }, ) ``` #### src/components/ui/attachment/attachment.astro ```astro --- /** * Root container for a file or image attachment. * Compose media, content, actions, and an optional full-card trigger inside it. * * @see https://ui.shadcn.com/docs/components/base/attachment */ import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import { attachmentVariants } from "./attachment-variants.ts" import type { AttachmentProps } from "./types.ts" type Props = HTMLAttributes<"div"> & AttachmentProps const { class: className, state = "done", size = "default", orientation = "horizontal", ...props } = Astro.props ---
``` #### src/components/ui/attachment/index.ts ```ts /** Attachment parts follow https://ui.shadcn.com/docs/components/base/attachment */ export { default as Attachment } from './attachment.astro' export { default as AttachmentAction } from './attachment-action.astro' export { default as AttachmentActions } from './attachment-actions.astro' export { default as AttachmentContent } from './attachment-content.astro' export { default as AttachmentDescription } from './attachment-description.astro' export { default as AttachmentGroup } from './attachment-group.astro' export { default as AttachmentMedia } from './attachment-media.astro' export { default as AttachmentTitle } from './attachment-title.astro' export { default as AttachmentTrigger } from './attachment-trigger.astro' export type { AttachmentActionProps, AttachmentMediaProps, AttachmentProps, AttachmentState, } from './types.ts' ``` #### src/components/ui/attachment/types.ts ```ts import type { ButtonProps } from '../button/types.ts' /** Upload lifecycle state for an attachment card. */ export type AttachmentState = | 'idle' | 'uploading' | 'processing' | 'error' | 'done' /** * Props for the root attachment container. * HTML attributes such as `class` and `id` pass through on the element. */ export interface AttachmentProps { /** * Upload state. Drives border treatment and title shimmer while in progress. * * @default done */ state?: AttachmentState /** * Attachment density. * * @default default */ size?: 'default' | 'sm' | 'xs' /** * Lay media beside or above the text content. * * @default horizontal */ orientation?: 'horizontal' | 'vertical' } /** * Props for the attachment media slot. * HTML attributes such as `class` pass through on the element. */ export interface AttachmentMediaProps { /** * Whether the slot holds an icon or an image preview. * * @default icon */ variant?: 'icon' | 'image' } /** * Props for an attachment action control. * Button attributes such as `aria-label`, `variant`, and `disabled` pass through. */ export interface AttachmentActionProps { /** * Button size for the icon action. * * @default icon-xs */ size?: ButtonProps['size'] } ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. The `Attachment` parts display a file or image attachment, its media, name, and metadata, with optional actions and upload state. Use them for files and images in chat composers, message threads, and upload lists. ## Usage ```ts import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentMedia, AttachmentTitle, } from "@/components/ui/attachment" ``` ```astro --- import FileText from "@lucide/astro/icons/file-text" import X from "@lucide/astro/icons/x" import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentMedia, AttachmentTitle, } from "@/components/ui/attachment" --- sales-dashboard.pdf PDF · 2.4 MB ``` ## Composition ```text Attachment ├── AttachmentMedia ├── AttachmentContent │ ├── AttachmentTitle │ └── AttachmentDescription ├── AttachmentActions │ └── AttachmentAction └── AttachmentTrigger ``` Use `AttachmentGroup` to lay out multiple attachments in a scrollable row: ```text AttachmentGroup ├── Attachment └── Attachment ``` ## Image Set `variant="image"` on `AttachmentMedia` and render an `` or `Image` inside it. Use `orientation="vertical"` to stack the media above the content. ```astro --- import X from "@lucide/astro/icons/x" import { Image } from "astro:assets" import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentGroup, AttachmentDescription, AttachmentMedia, AttachmentTitle, } from "@/components/ui/attachment" import winterLandscapeOrion from "@/assets/images/winter-landscape-orion.png" import winterLandcapeTheta from "@/assets/images/winter-landscape-theta.png" import futuristicStorm from "@/assets/images/futuristic-storm.png" const images = [ { src: futuristicStorm, alt: "Futuristic storm", title: "futuristic-storm.png", description: "PNG · 820 KB", }, { src: winterLandscapeOrion, alt: "Winter landscape", title: "winter-landscape-orion.png", description: "PNG · 820 KB", }, { src: winterLandcapeTheta, alt: "Winter landscape", title: "winter-landscape-theta.png", description: "PNG · 820 KB", }, ] --- {images.map((image) => ( {image.alt} {image.title} {image.description} ))} ``` ## States Set `state` on `Attachment` to reflect the upload lifecycle. `uploading` and `processing` shimmer the title, and `error` switches to a destructive treatment. Keep the failure reason in `AttachmentDescription` so the state is not conveyed by color alone. ```astro --- import FileCode from "@lucide/astro/icons/file-code" import FileText from "@lucide/astro/icons/file-text" import { Attachment, AttachmentContent, AttachmentDescription, AttachmentMedia, AttachmentTitle, } from "@/components/ui/attachment" import { Spinner } from "@/components/ui/spinner" ---
sales-dashboard.pdf Uploading · 64% message-renderer.tsx Processing… desk-reference.jpg Upload failed · try again message-renderer.tsx TypeScript · 12 KB
``` ## Sizes Use `size` to switch between `default`, `sm`, and `xs`. ```astro --- import FileText from "@lucide/astro/icons/file-text" import { Attachment, AttachmentContent, AttachmentDescription, AttachmentMedia, AttachmentTitle, } from "@/components/ui/attachment" ---
sales-dashboard.pdf PDF · 2.4 MB sales-dashboard.pdf PDF · 2.4 MB sales-dashboard.pdf PDF · 2.4 MB
``` ## Group Wrap attachments in `AttachmentGroup` to lay them out in a horizontally scrollable, snapping row with an edge fade. ```astro --- import FileText from "@lucide/astro/icons/file-text" import ImageIcon from "@lucide/astro/icons/image" import { Attachment, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, } from "@/components/ui/attachment" --- workspace.png PNG · 820 KB research-summary.pdf PDF · 1.8 MB release-notes.md Markdown · 24 KB ``` ## Trigger Add an `AttachmentTrigger` to make the whole card open a link or dialog. It fills the card behind the actions, so the actions stay clickable. Give icon-only actions and the trigger an `aria-label` that names the file and the action. ```astro --- import FileText from "@lucide/astro/icons/file-text" import X from "@lucide/astro/icons/x" import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentMedia, AttachmentTitle, AttachmentTrigger, } from "@/components/ui/attachment" import { Lightbox, LightboxContent } from "@/components/ui/lightbox" --- Attention is All You Need PDF · arXiv:1706.03762 Attention Is All You Need {" "} (Vaswani et al., arXiv:1706.03762) ``` For a dialog or lightbox, put the attachment inside its root and set `data-slot="dialog-trigger"` on `AttachmentTrigger`. The dialog controller binds the trigger within that root. No ID lookup or custom click handler is needed. ```astro {/* ... */} ``` ## API Reference ### AttachmentProps ### AttachmentMediaProps ### AttachmentActionProps Read the [installed source](/r/attachment.json) for the complete prop types. ## Theme and layout Attachment uses shared component recipes and semantic colors. Choose the size and orientation that fit the surrounding form or file list. Keep file names readable and actions distinct from the preview. Use [Field](/components/field) for input labels and messages; the attachment view does not perform an upload. --- # Avatar for Astro Source: https://ui.gnosticai.com/components/avatar ```astro --- import { Avatar, AvatarFallback, AvatarGroup, AvatarImage, } from "@/components/ui/avatar" import { agentAvatars } from "@/lib/agent-avatars" ---
SV SV MR SV SV SV
``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/avatar ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. No extra packages are required. #### src/components/ui/avatar/avatar-badge.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"span"> const { class: className, ...props } = Astro.props --- svg]:hidden group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2 group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className)} {...props} > ``` #### src/components/ui/avatar/avatar-fallback.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/avatar/avatar-group-count.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className)} {...props} >
``` #### src/components/ui/avatar/avatar-group.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
``` #### src/components/ui/avatar/avatar-image.astro ```astro --- import { Image } from "astro:assets" import type { ComponentProps } from "astro/types" import { cn } from "cn" type Props = Partial> const { class: className, alt = "", width = 44, height = 44, sizes = "44px", widths = [44, 88, 176], ...props } = Astro.props --- {props.src && ( {alt} )} ``` #### src/components/ui/avatar/avatar.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> & { size?: "default" | "sm" | "lg" } const { class: className, size = "default", ...props } = Astro.props ---
``` #### src/components/ui/avatar/index.ts ```ts export { default as Avatar } from "./avatar.astro" export { default as AvatarBadge } from "./avatar-badge.astro" export { default as AvatarFallback } from "./avatar-fallback.astro" export { default as AvatarGroup } from "./avatar-group.astro" export { default as AvatarGroupCount } from "./avatar-group-count.astro" export { default as AvatarImage } from "./avatar-image.astro" ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```ts import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" ``` ```astro TM ``` ## Composition Arrange the parts as shown for an `Avatar`: ```text Avatar ├── AvatarImage ├── AvatarFallback └── AvatarBadge ``` Arrange the parts as shown for an `AvatarGroup`: ```text AvatarGroup ├── Avatar │ ├── AvatarImage │ ├── AvatarFallback │ └── AvatarBadge ├── Avatar │ ├── AvatarImage │ ├── AvatarFallback │ └── AvatarBadge └── AvatarGroupCount ``` ## Examples ### Fallback Use `AvatarFallback` when an image is unavailable or intentionally omitted. ```astro --- import { Avatar, AvatarFallback } from "@/components/ui/avatar" --- MR ``` ### Group Use `AvatarGroup` when you need overlapping participant or collaborator lists. ```astro --- import { Avatar, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, } from "@/components/ui/avatar" import { agentAvatars } from "@/lib/agent-avatars" --- SV TM +3 ``` ## Notes - Always include `AvatarFallback` so initials or placeholder content remain visible when the image fails to load. - Use size variants on `Avatar` instead of custom width and height classes when possible. ## API Reference Read the [installed source](/r/avatar.json) for the complete prop types. ## When to use Avatar Use Avatar beside a person or team name. Put AvatarImage and AvatarFallback inside the same root. Use initials or a short mark for the fallback, and choose one size for a row of related people. ## Keyboard and behavior Supply meaningful image alternative text if the image conveys identity that is absent from nearby text. Use empty alt text when the adjacent name already supplies it. This Astro version does not include Base UI image loading state; a broken image URL does not automatically switch to the fallback. ## Theme and layout The root clips content to its rounded shape and the fallback uses muted colors. Check long initials and transparent logos in both modes. Resolve an absent image in your data before rendering when you need a reliable fallback. --- # Badge for Astro Source: https://ui.gnosticai.com/components/badge ```astro --- import BadgeCheck from "@lucide/astro/icons/badge-check" import { Badge, type BadgeVariantProps, badgeVariants, } from "@/components/ui/badge" const badgeSizes = [ "sm", "default", "lg", ] as const satisfies BadgeVariantProps["size"][] const variants = [ "default", "secondary", "success", "warning", "info", "destructive", "error", "outline", "ghost", "link", ] as const satisfies BadgeVariantProps["variant"][] const badges = variants.flatMap((variant) => badgeSizes.map((size) => ({ size, variant })), ) ---
{badges.map(({ size, variant }) => (
{variant}
))}
``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/badge ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. No extra packages are required. #### src/components/ui/badge/badge-variants.ts ```ts import { cva, type VariantProps } from 'class-variance-authority' import { cn } from 'cn' const badgeStyles = cva("font-sans focus-visible:ring-ring focus-visible:ring-offset-background relative inline-flex shrink-0 items-center justify-center gap-1 rounded-sm border border-transparent font-medium whitespace-nowrap transition-shadow outline-none focus-visible:ring-2 focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-64 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3 [button&,a&]:cursor-pointer [button&,a&]:pointer-coarse:after:absolute [button&,a&]:pointer-coarse:after:size-full [button&,a&]:pointer-coarse:after:min-h-11 [button&,a&]:pointer-coarse:after:min-w-11", { defaultVariants: { size: 'default', variant: 'default', }, variants: { size: { default: "h-5.5 min-w-5.5 px-[calc(--spacing(1)-1px)] text-sm sm:h-4.5 sm:min-w-4.5 sm:text-xs", lg: "h-6.5 min-w-6.5 px-[calc(--spacing(1.5)-1px)] text-base sm:h-5.5 sm:min-w-5.5 sm:text-sm", sm: "h-5 min-w-5 rounded-[.25rem] px-[calc(--spacing(1)-1px)] text-xs sm:h-4 sm:min-w-4 sm:text-[.625rem]", }, variant: { error: 'bg-destructive/8 text-destructive-foreground dark:bg-destructive/16', info: 'bg-info/8 text-info-foreground dark:bg-info/16', success: 'bg-success/8 text-success-foreground dark:bg-success/16', warning: 'bg-warning/8 text-warning-foreground dark:bg-warning/16', ghost: "text-foreground hover:bg-accent border-transparent", link: "text-primary border-transparent underline-offset-4 hover:underline", default: "bg-primary text-primary-foreground [button&,a&]:hover:bg-primary/90", destructive: "bg-destructive [button&,a&]:hover:bg-destructive/90 text-white", outline: "border-input bg-background text-foreground dark:bg-input/32 [button&,a&]:hover:bg-accent/50 dark:[button&,a&]:hover:bg-input/48", secondary: "bg-secondary text-secondary-foreground [button&,a&]:hover:bg-secondary/90", }, }, }) export const badgeVariants = (...args: Parameters) => cn(badgeStyles(...args)) export type BadgeVariantProps = VariantProps ``` #### src/components/ui/badge/badge.astro ```astro --- import type { HTMLTag, Polymorphic } from "astro/types" import { cn } from "cn" import { badgeVariants, type BadgeVariantProps } from "./badge-variants" type Props = Polymorphic<{ as: Tag }> & BadgeVariantProps const { as: Tag = "span", class: className, variant = "default", size = "default", ...props } = Astro.props --- ``` #### src/components/ui/badge/index.ts ```ts export { badgeVariants, type BadgeVariantProps } from "./badge-variants" export { default as Badge } from "./badge.astro" ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```ts import { Badge } from "@/components/ui/badge" ``` ```astro Badge ``` ### Link Use the polymorphic `as` prop to render the badge as a link element. ```astro --- import { Badge } from "@/components/ui/badge" --- Badge ``` ### Polymorphic `Badge` is strict polymorphic. Pass `as` to change the rendered element and use attributes for that element. ```astro Action Docs ``` ## Notes - Use variants first before adding custom classes. - `Badge` works well for status labels, counts, and small inline metadata. ## With an icon Put a check icon in the badge. The badge sets the icon size. ```astro --- import Check from "@lucide/astro/icons/check" import { Badge } from "@/components/ui/badge" ---
Verified Verified Verified
``` ## With a count Add `rounded-full` when the badge shows a notification count. ```astro --- import { Badge } from "@/components/ui/badge" ---
8 3 12
``` ## API Reference Read the [installed source](/r/badge.json) for the complete prop types. ## When to use Badge Use Badge for a short fact attached to another object. Keep the text brief and choose a semantic variant only when the meaning is clear. The size prop changes density without requiring a different component. ## Keyboard and behavior A badge is a label, not an action by default. Do not depend on its color alone to communicate status. If you make it a link through its supported element props, use a clear destination label and keep the focus style. ## Theme and layout The variants share semantic color tokens with alerts and buttons. Test the small size with the actual label text. Long sentences belong in a description or alert instead of a badge. --- # Banner for Astro Source: https://ui.gnosticai.com/components/banner ## Usage ```ts import { Banner, BannerContainer } from "@/components/ui/banner" ``` ```astro

Banner Title

Banner Description

``` `BannerContainer` renders a close button by default. Set `showClose={false}` to hide it. ```astro

Banner Title

Banner Description

``` ## Examples ```astro --- import { Banner, BannerContainer } from "@/components/ui/banner" ---

New docs are live

Browse the latest component examples and installation guides.

``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/banner ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. No extra packages are required. #### src/components/ui/banner/banner-container.astro ```astro --- import type { HTMLAttributes } from "astro/types" import XIcon from "@lucide/astro/icons/x" import { cn } from "cn" type Props = HTMLAttributes<"div"> & { showClose?: boolean } const { class: className, showClose = true, ...props } = Astro.props ---
{showClose && ( )}
``` #### src/components/ui/banner/banner.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "cn" type Props = HTMLAttributes<"aside"> & VariantProps & { storageKey?: string } const variants = cva("@container relative flex items-center py-2", { variants: { variant: { default: "bg-foreground text-background w-full", floating: "bg-background mx-auto my-2 w-[calc(100%-2rem)] max-w-[calc(var(--container,1280px)-2rem)] overflow-hidden rounded-lg border shadow-sm", }, }, defaultVariants: { variant: "default", }, }) const { class: className, variant, storageKey, ...props } = Astro.props --- ``` #### src/components/ui/banner/index.ts ```ts export { default as Banner } from "./banner.astro" export { default as BannerContainer } from "./banner-container.astro" ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ```astro --- import { Banner, BannerContainer } from "@/components/ui/banner" ---

Launch

New component docs are ready.

``` ## Notes - The default banner spans its available width. - Set `variant="floating"` for a bar with an inset surface. ## API Reference Read the [installed source](/r/banner.json) for the complete prop types. ## When to use Banner Place a Banner near the top of the page for a service notice or current announcement. Use the default or floating layout to suit the page shell, then add message and action parts through slots. ## Keyboard and behavior A dismissal control needs a clear accessible name. If you use `storageKey`, the client behavior can retain the dismissed state; change the key when the notice itself changes. Important information must also remain available elsewhere after dismissal. ## Theme and layout Check long text beside the action at a narrow width. Shared background and border tokens keep the banner consistent with the page, but a persistent banner must not cover a focused control or heading. --- # Breadcrumb for Astro Source: https://ui.gnosticai.com/components/breadcrumb ```astro --- import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb" --- Home Components Breadcrumb ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/breadcrumb ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. No extra packages are required. #### src/components/ui/breadcrumb/types.ts ````ts export type BreadcrumbMenuProps = { /** * The items to display in the breadcrumb menu. * @example * ```ts * [ * { label: "Home", href: "/" }, * { label: "Components", href: "/components" }, * { label: "Breadcrumb", href: "/components/breadcrumb" }, * ] * ``` */ items: { label: string href: string }[] } ```` #### src/components/ui/breadcrumb/breadcrum-menu.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { DropdownMenu, DropdownMenuItem, DropdownMenuContent, DropdownMenuTrigger, } from "../dropdown-menu" import type { BreadcrumbMenuProps } from "./types" import Ellipsis from "@lucide/astro/icons/ellipsis" import { cn } from "cn" import { buttonVariants } from "../button" type Props = HTMLAttributes<"div"> & BreadcrumbMenuProps const { items, class: className, ...props } = Astro.props satisfies Props --- {items.map((item) => ( {item.label} ))} ``` #### src/components/ui/breadcrumb/breadcrumb-ellipsis.astro ```astro --- import type { HTMLAttributes, HTMLTag, Polymorphic } from "astro/types" import Ellipsis from "@lucide/astro/icons/ellipsis" import { cn } from "cn" type Props = Polymorphic<{ as: Tag }> const { as: Tag = "span", class: className, ...props } = Astro.props --- svg]:size-4", className)} {...props} > More ``` #### src/components/ui/breadcrumb/breadcrumb-item.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"li"> const { class: className, ...props } = Astro.props ---
  • ``` #### src/components/ui/breadcrumb/breadcrumb-link.astro ```astro --- import type { HTMLTag, Polymorphic } from "astro/types" import { cn } from "cn" type Props = Polymorphic<{ as: Tag }> const { as: Tag = "a", class: className, ...props } = Astro.props --- ``` #### src/components/ui/breadcrumb/breadcrumb-list.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"ol"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/breadcrumb/breadcrumb-page.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"span"> const { class: className, ...props } = Astro.props --- ``` #### src/components/ui/breadcrumb/breadcrumb-separator.astro ```astro --- import type { HTMLAttributes } from "astro/types" import ChevronRight from "@lucide/astro/icons/chevron-right" import { cn } from "cn" type Props = HTMLAttributes<"li"> const { class: className, ...props } = Astro.props --- ``` #### src/components/ui/breadcrumb/breadcrumb.astro ```astro --- import type { HTMLAttributes } from "astro/types" type Props = HTMLAttributes<"nav"> const { class: className, ...props } = Astro.props --- ``` #### src/components/ui/breadcrumb/index.ts ```ts export { default as Breadcrumb } from './breadcrumb.astro' export { default as BreadcrumbEllipsis } from './breadcrumb-ellipsis.astro' export { default as BreadcrumbItem } from './breadcrumb-item.astro' export { default as BreadcrumbLink } from './breadcrumb-link.astro' export { default as BreadcrumbList } from './breadcrumb-list.astro' export { default as BreadcrumbPage } from './breadcrumb-page.astro' export { default as BreadcrumbSeparator } from './breadcrumb-separator.astro' export { default as BreadcrumbMenu } from './breadcrum-menu.astro' export type { BreadcrumbMenuProps } from './types' ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```ts import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb" ``` ```astro Home Current Page ``` ## Composition Arrange the parts as shown for a `Breadcrumb`: ```text Breadcrumb └── BreadcrumbList ├── BreadcrumbItem │ └── BreadcrumbLink ├── BreadcrumbSeparator ├── BreadcrumbItem │ └── BreadcrumbLink ├── BreadcrumbSeparator └── BreadcrumbItem └── BreadcrumbPage ``` ## Examples ### Basic ```astro --- import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb" --- Home / Components / Data ``` ### With Menu The ellipse can be a trigger for a [dropdown menu](/components/dropdown-menu), to truncate the breadcrumb trail, while preserving the full trail in a menu. ```astro --- import { Breadcrumb, BreadcrumbMenu, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, type BreadcrumbMenuProps, } from "@/components/ui/breadcrumb" const items = [ { label: "Components", href: "#" }, { label: "Subfolder", href: "#" }, { label: "Links", href: "#" }, ] satisfies BreadcrumbMenuProps["items"] --- Home Breadcrumb ``` ## API Reference ### BreadcrumbMenuProps ## When to use Breadcrumb Build a Breadcrumb from list items and links ordered from the parent section to the current page. Use BreadcrumbPage for the final item. The trail describes the site hierarchy; it does not need to reproduce browser history. ## Keyboard and behavior Links retain native keyboard and browser behavior. Name multiple navigation regions so users can tell them apart. Separators are visual punctuation and should not add extra spoken content. ## Theme and layout Muted text and hover styles follow the theme. Let long labels wrap or shorten them with meaningful wording. An ellipsis only displays a gap; add a menu yourself if hidden ancestors must be available. --- # Button for Astro Source: https://ui.gnosticai.com/components/button ```astro --- import ArrowUpRight from "@lucide/astro/icons/arrow-up-right" import { Button } from "@/components/ui/button" --- ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/button ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. No extra packages are required. #### src/components/ui/button/button-variants.ts ```ts import { cva, type VariantProps } from 'class-variance-authority' export const buttonVariants = cva( "font-sans focus-visible:ring-ring focus-visible:ring-offset-background relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-lg border text-base font-medium whitespace-nowrap transition-shadow outline-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-offset-1 disabled:opacity-64 sm:text-sm pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 [&_svg]:pointer-events-none [&_svg]:-mx-0.5 [&_svg]:shrink-0 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 group/button disabled:pointer-events-none data-loading:text-transparent data-loading:select-none", { compoundVariants: [ { variant: 'outline', size: ['icon', 'icon-xs', 'icon-sm', 'icon-lg', 'icon-xl'], class: "", }, ], defaultVariants: { size: 'default', variant: 'default', }, variants: { size: { default: "h-9 px-[calc(--spacing(3)-1px)] sm:h-8", icon: "size-9 sm:size-8", 'icon-lg': "size-10 sm:size-9", 'icon-sm': "size-8 sm:size-7", 'icon-xl': "size-11 sm:size-10 [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5", 'icon-xs': "size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*='size-'])]:size-3.5", lg: "h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9", sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7", xl: "h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*='size-'])]:size-5 sm:[&_svg:not([class*='size-'])]:size-4.5", xs: "h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5", }, variant: { glass: "border-white/24 border bg-white/14 text-white hover:bg-white/18 before:bg-white/0 relative backdrop-blur-sm before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:transition-[background-color] before:duration-300 before:ease-in-out hover:before:bg-white/8", surface: "border-border bg-card text-card-foreground hover:bg-accent", 'destructive-outline': "border-input bg-popover text-destructive-foreground hover:border-destructive/32 hover:bg-destructive/4 data-pressed:border-destructive/32 data-pressed:bg-destructive/4 *:data-[slot=button-loading-indicator]:text-foreground dark:bg-input/32 shadow-xs/5 not-dark:bg-clip-padding not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none", default: "border-primary bg-primary text-primary-foreground shadow-primary/24 hover:bg-primary/90 data-pressed:bg-primary/90 *:data-[slot=button-loading-indicator]:text-primary-foreground shadow-xs not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none", destructive: "border-destructive bg-destructive shadow-destructive/24 hover:bg-destructive/90 data-pressed:bg-destructive/90 text-white shadow-xs not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] *:data-[slot=button-loading-indicator]:text-white [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none", ghost: "text-foreground hover:bg-accent data-pressed:bg-accent *:data-[slot=button-loading-indicator]:text-foreground border-transparent", link: "text-foreground *:data-[slot=button-loading-indicator]:text-foreground border-transparent underline-offset-4 hover:underline data-pressed:underline", outline: "border-input bg-popover text-foreground hover:bg-accent/50 data-pressed:bg-accent/50 *:data-[slot=button-loading-indicator]:text-foreground dark:bg-input/32 dark:data-pressed:bg-input/64 dark:hover:bg-input/64 shadow-xs/5 not-dark:bg-clip-padding not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none", secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/90 data-pressed:bg-secondary/90 *:data-[slot=button-loading-indicator]:text-secondary-foreground [:active,[data-pressed]]:bg-secondary/80 border-transparent", }, }, }, ) export type ButtonVariantProps = VariantProps ``` #### src/components/ui/button/button.astro ```astro --- import type { HTMLTag, Polymorphic } from "astro/types" import { Spinner } from "../spinner" import { cn } from "cn" import { buttonVariants } from "./button-variants" import type { ButtonProps } from "./types" type Props = Polymorphic<{ as: Tag }> & ButtonProps const { as: Tag = "href" in Astro.props ? "a" : "button", class: className, variant = "default", size = "default", withLoader = false, ...props } = Astro.props // Props validates the selected tag at the call site. The render tag is dynamic. const elementProps: Record = { ...(Tag === "button" ? { type: "button" as const } : {}), ...props, } --- {withLoader && ( )} ``` #### src/components/ui/button/index.ts ```ts export { buttonVariants, type ButtonVariantProps } from "./button-variants" export { default as Button } from "./button.astro" ``` #### src/components/ui/button/types.ts ```ts import type { HTMLTag } from 'astro/types' import type { ButtonVariantProps } from './button-variants' export interface ButtonProps extends ButtonVariantProps { /** * The HTML tag to render the button as. * * @default 'button' */ as?: HTMLTag /** * Add the built-in loading indicator. It will remain hidden until the button's `data-loading` attribute is set to `true`. * * @default false */ withLoader?: boolean } ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```ts import { Button } from "@/components/ui/button" ``` You can also import `buttonVariants` to reuse button styles on other HTML elements. Pass `size` and `variant` to the helper. It supplies the classes for the project preset selected during installation. No extra data attributes are needed to select those styles. Keep a trigger's existing `data-slot` when you style another component this way. ```astro --- import { buttonVariants } from "@/components/ui/button" --- ``` ### Link Use [Link](/components/link) for a page path, an external URL, a phone number, or an email address. `Button` can render an anchor when you only need button styles on a simple href. ```astro --- import { Button } from "@/components/ui/button" --- ``` ### Polymorphic `Button` is polymorphic via `as`. Pass `as` to change the rendered element and use the relevant attributes for that element. ```astro ``` ## Examples ### Sizes ```astro --- import ArrowUpRight from "@lucide/astro/icons/arrow-up-right" import { Button } from "@/components/ui/button" --- ``` ### Default ```astro --- import { Button } from "@/components/ui/button" --- ``` ### Ghost ```astro --- import { Button } from "@/components/ui/button" --- ``` ### Outline ```astro --- import { Button } from "@/components/ui/button" --- ``` ### Glass The glass variant uses a translucent fill and a backdrop blur. Put the button on a photo so the image shows through the control. ```astro --- import { Image } from "astro:assets" import { Button } from "@/components/ui/button" import city from "@/assets/images/futuristic-city.png" ---
    A coastal city at dusk, with lights along a curved road
    ``` ### Secondary ```astro --- import { Button } from "@/components/ui/button" --- ``` ### Destructive ```astro --- import { Button } from "@/components/ui/button" --- ``` ### Destructive Outline ```astro --- import { Button } from "@/components/ui/button" import Trash from "@lucide/astro/icons/trash" --- ``` ### Link ```astro --- import { Button } from "@/components/ui/button" --- ``` ### With Icon The spacing between the icon and the text is automatically adjusted based on the size of the button. You do not need any margin on the icon. ```astro --- import GitBranch from "@lucide/astro/icons/git-branch" import { Button } from "@/components/ui/button" --- ``` ### Icon only ```astro --- import Flame from "@lucide/astro/icons/flame" import { Button } from "@/components/ui/button" --- ``` ### Rounded Use the `rounded-full` class to make the button rounded. ```astro --- import ArrowUp from "@lucide/astro/icons/arrow-up" import { Button } from "@/components/ui/button" --- ``` ### Loading (Built-in) Use the `withLoader` prop to show a built-in loading indicator. Then just set the `data-loading` attribute to show a loading indicator. ```astro --- import { Button } from "@/components/ui/button" --- ``` ### Loading (Custom) Pass a custom loading indicator by adding the `button-loading-indicator` slot. :::note To show a loading indicator without replacing the content, don't set a slot name. ::: ```astro --- import { Button } from "@/components/ui/button" import LoaderIcon from "@lucide/astro/icons/loader" --- ``` ## Sizes and states ```astro --- import { Button, type ButtonVariantProps } from "@/components/ui/button" const variants: ButtonVariantProps["variant"][] = [ "default", "secondary", "outline", "ghost", "destructive", "destructive-outline", "link", "glass", "surface", ] ---
    {variants.map((variant) => (
    ))}
    ``` ## API Reference ### ButtonProps Read the [installed source](/r/button.json) for the complete prop types. ## When to use Button Use a button for a page action, such as saving a form. Use [Link](/components/link) for a destination. The default slot holds the label and optional icon. Set `type="button"` for actions inside a form that must not submit it. ## Keyboard and behavior A native button supports Enter and Space. A link supports Enter and normal browser link actions. Give an icon-only button an `aria-label`. The `withLoader` option and `data-loading` attribute change the display; your code must start the work, prevent repeat requests when needed, and report the result. ## Theme and layout The variants use the shared primary, secondary, and destructive tokens. Keep the default variant for the main action and use outline or ghost for nearby controls. A class override can change one button without changing the site palette. The component does not require a client controller for normal form submission or navigation. --- # Button Group for Astro Source: https://ui.gnosticai.com/components/button-group ```astro --- import { Button } from "@/components/ui/button" import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, } from "@/components/ui/button-group" ---
    100%
    ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/button-group ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. No extra packages are required. #### src/components/ui/button-group/button-group-separator.astro ```astro --- import type { ComponentProps } from "astro/types" import { cn } from "cn" import { Separator } from "../separator" type Props = ComponentProps const { class: className, orientation = "vertical", ...props } = Astro.props --- ``` #### src/components/ui/button-group/button-group-text.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/button-group/button-group-variants.ts ```ts import { cva, type VariantProps } from 'class-variance-authority' export const buttonGroupVariants = cva( 'dark:*:[[data-slot=separator]:has(~button:hover):not(:has(~[data-slot=separator]~[data-slot]:hover)),[data-slot=separator]:has(~[data-slot][aria-pressed=true]):not(:has(~[data-slot=separator]~[data-slot][aria-pressed=true]))]:before:bg-input/64 dark:*:[button:hover~[data-slot=separator]:not([data-slot]:hover~[data-slot=separator]~[data-slot=separator]),[data-slot][aria-pressed=true]~[data-slot=separator]:not([data-slot][aria-pressed=true]~[data-slot=separator]~[data-slot=separator])]:before:bg-input/64 flex w-fit *:focus-visible:z-1 *:has-focus-visible:z-1 has-[>[data-slot=button-group]]:gap-2', { defaultVariants: { orientation: 'horizontal', }, variants: { orientation: { horizontal: '*:data-slot:has-[~[data-slot]]:rounded-e-none *:data-slot:has-[~[data-slot]]:border-e-0 *:data-slot:has-[~[data-slot]]:before:rounded-e-none *:data-slot:not-data-[slot=separator]:has-[~[data-slot]]:before:inset-e-[-0.5px] *:pointer-coarse:after:min-w-auto *:[[data-slot]~[data-slot]]:rounded-s-none *:[[data-slot]~[data-slot]]:border-s-0 *:[[data-slot]~[data-slot]]:before:rounded-s-none *:[[data-slot]~[data-slot]:not([data-slot=separator])]:before:inset-s-[-0.5px]', vertical: 'flex-col *:data-slot:has-[~[data-slot]]:rounded-b-none *:data-slot:has-[~[data-slot]]:border-b-0 *:data-slot:has-[~[data-slot]]:before:rounded-b-none *:data-slot:not-data-[slot=separator]:has-[~[data-slot]]:before:bottom-[-0.5px] *:data-slot:not-data-[slot=separator]:has-[~[data-slot]]:before:hidden dark:*:first:before:block dark:*:last:before:hidden *:pointer-coarse:after:min-h-auto *:[[data-slot]~[data-slot]]:rounded-t-none *:[[data-slot]~[data-slot]]:border-t-0 *:[[data-slot]~[data-slot]]:before:rounded-t-none *:[[data-slot]~[data-slot]:not([data-slot=separator])]:before:top-[-0.5px]', }, }, }, ) export type ButtonGroupVariantProps = VariantProps ``` #### src/components/ui/button-group/button-group.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import { buttonGroupVariants } from "./button-group-variants.ts" import type { ButtonGroupProps } from "./types.ts" /** Div attributes pass through. Give the group an accessible name. */ type Props = HTMLAttributes<"div"> & ButtonGroupProps const { class: className, orientation = "horizontal", ...props } = Astro.props ---
    ``` #### src/components/ui/button-group/index.ts ```ts export { default as ButtonGroup } from './button-group.astro' export { default as ButtonGroupSeparator } from './button-group-separator.astro' export { default as ButtonGroupText } from './button-group-text.astro' export { buttonGroupVariants } from './button-group-variants.ts' export type { ButtonGroupProps } from './types.ts' ``` #### src/components/ui/button-group/types.ts ```ts /** * Props for a joined set of buttons. * Div attributes such as `class`, `id`, and `aria-label` pass through. * Place each button directly inside the group. */ export interface ButtonGroupProps { /** * Direction of the joined controls. * * @default "horizontal" */ orientation?: 'horizontal' | 'vertical' } ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```astro --- import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, } from "@/components/ui/button-group" import { Button } from "@/components/ui/button" --- ``` ```astro index.astro wrap lineNumbers ``` Set `orientation="vertical"` for a column. `ButtonGroupText` adds a label. `ButtonGroupSeparator` adds a divider. A horizontal group uses a vertical separator. ## Composition Place the parts directly inside `ButtonGroup`: ```text ButtonGroup ├── Button ├── ButtonGroupSeparator ├── Button └── ButtonGroupText ``` `ButtonGroupSeparator` is optional. Its default orientation is vertical, which fits a horizontal group. Set `orientation="horizontal"` on the separator when the group is vertical. ## API Reference ### ButtonGroupProps Div attributes such as `class`, `id`, and `aria-label` pass through. `ButtonGroupSeparator` accepts [Separator](/components/separator) attributes such as `class` and `orientation`. `ButtonGroupText` accepts div attributes such as `class`. Read the [installed source](/r/button-group.json) for the component source. ## When to use Button Group Use Button Group when several buttons act on the same content and should read as one control. Put the group label in `aria-label` when nearby text does not name the group. Each button keeps its own label. Give an icon-only button an accessible name. ## Keyboard and behavior The group uses `role="group"`. Each button keeps its own native keyboard behavior. This layout does not add arrow-key navigation or a pressed state. Use [Toggle Group](/components/toggle-group) when the visitor keeps one option pressed. ## Theme and layout The outer buttons keep rounded corners. The inner edges join. Keep button sizes equal so the shared border stays even. Check visible focus around the shared borders, especially when a button is disabled. --- # Card for Astro Source: https://ui.gnosticai.com/components/card ```astro --- import { Button } from "@/components/ui/button" import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card" --- Client site handoff Review the content and access details before the site handoff.

    The page copy is approved. Two image descriptions still need review.

    ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/card ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. No extra packages are required. #### src/components/ui/card/card-action.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/card/card-content.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    [data-slot=card-footer]:not(.border-t))]:pb-0 in-[[data-slot=card]:has(>[data-slot=card-header]:not(.border-b))]:pt-0", className)} {...props} >
    ``` #### src/components/ui/card/card-description.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/card/card-footer.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    [data-slot=card-content])]:pt-[calc(var(--card-spacing)*2/3)]", className)} {...props}>
    ``` #### src/components/ui/card/card-frame-action.astro ```astro --- /** * Header action for a framed card. Place it after the title and description. */ import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/card/card-frame-description.astro ```astro --- /** * Supporting text under a framed card title. */ import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/card/card-frame-footer.astro ```astro --- /** * Footer band for a framed card. Body actions stay in CardFooter. */ import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/card/card-frame-header.astro ```astro --- /** * Header grid for a framed card. * An action in the third slot sits on the right. */ import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/card/card-frame-title.astro ```astro --- /** * Title for a framed card header. Size matches the Coss frame title. */ import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/card/card-frame.astro ```astro --- /** * Framed card shell from Coss UI. * The muted fill sits on a pseudo-element so the inner card can clip into the border. */ import type { HTMLTag, Polymorphic } from "astro/types" import { cn } from "cn" import type { CardFrameProps } from "./types.ts" type Props = Polymorphic<{ as: Tag }> & CardFrameProps const { as: Tag = "div", class: className, ...props } = Astro.props --- ``` #### src/components/ui/card/card-header.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    [data-slot=card-content])]:pb-[calc(var(--card-spacing)*2/3)] has-data-[slot=card-action]:grid-cols-[1fr_auto] group/card-header", className)} {...props} >
    ``` #### src/components/ui/card/card-title.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/card/card.astro ```astro --- import type { HTMLTag, Polymorphic } from "astro/types" import { cn } from "cn" import type { CardProps } from "./types.ts" type Props = Polymorphic<{ as: Tag }> & CardProps const { as: Tag = "div", class: className, size = "default", ...props } = Astro.props --- img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)] *:[img:first-child]:rounded-t-2xl *:[img:last-child]:rounded-b-2xl group/card", className)} {...props} > ``` #### src/components/ui/card/index.ts ```ts export { default as Card } from './card.astro' export type { CardFrameProps, CardProps } from './types.ts' export { default as CardAction } from './card-action.astro' export { default as CardContent } from './card-content.astro' export { default as CardDescription } from './card-description.astro' export { default as CardFooter } from './card-footer.astro' export { default as CardFrame } from './card-frame.astro' export { default as CardFrameAction } from './card-frame-action.astro' export { default as CardFrameDescription } from './card-frame-description.astro' export { default as CardFrameFooter } from './card-frame-footer.astro' export { default as CardFrameHeader } from './card-frame-header.astro' export { default as CardFrameTitle } from './card-frame-title.astro' export { default as CardHeader } from './card-header.astro' export { default as CardTitle } from './card-title.astro' ``` #### src/components/ui/card/types.ts ```ts import type { HTMLTag } from 'astro/types' /** Root card container spacing and polymorphic element. */ export interface CardProps { /** * The HTML tag for the card root. * * @default 'div' */ as?: HTMLTag /** * Section inset scale through `--card-spacing`. * * @default 'default' */ size?: 'default' | 'sm' } /** Framed card shell with optional polymorphic root. */ export interface CardFrameProps { /** * The HTML tag for the frame root. * * @default 'div' */ as?: HTMLTag } ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```ts import { Card, CardAction, CardContent, CardDescription, CardFooter, CardFrame, CardHeader, CardTitle, } from "@/components/ui/card" ``` ```astro Card Title Card Description Card Action

    Card Content

    Card Footer

    ``` ### Polymorphic props :::note `Card` and `CardFrame` accept an `as` prop to change their root HTML element. Both use `div` by default. Use `as="article"` for an article or `as="a"` with `href` to make the whole card a link without an extra wrapper. These roots supply layout and styling, so they can use different tags. Their inner parts keep their existing tags. See the [polymorphic props rule](/docs#polymorphic-props) for components that require a specific element. Pass the selected element's attributes directly to the component. `as` takes a tag name, with no callback or child cloning. A card link must not contain other links, buttons, or other interactive controls. Keep a container root when the card has several actions. ::: ```astro Project summary

    Review the project scope and schedule.

    View projects ``` ## Spacing `--card-spacing` controls the section insets in a `Card`. Use `size="sm"` for less spacing, or set the variable on the card: ```astro Card content ``` `CardFrame` uses the same variable for the horizontal padding in its header and footer. Their vertical padding stays at `1rem`. The frame and its inner card each have their own spacing value. ## Composition Arrange the parts as shown for a `Card`: ```text Card ├── CardHeader │ ├── CardTitle │ ├── CardDescription │ └── CardAction ├── CardContent └── CardFooter CardFrame ├── CardFrameHeader │ ├── CardFrameTitle │ ├── CardFrameDescription │ └── CardFrameAction ├── Card │ ├── CardContent │ └── CardFooter (inside frame) └── CardFrameFooter (outside frame) ``` ## Examples ### Card frame `CardFrame` keeps its Gnostic frame styling with every preset. Its colors follow the selected theme. The inner `Card` uses the selected preset’s Card styles. `CardFrame` is the framed card shell. Put the title and the description in `CardFrameHeader`. The inner `Card` is the body. ```astro --- import { Card, CardContent, CardFrame, CardFrameDescription, CardFrameHeader, CardFrameTitle, } from "@/components/ui/card" --- Create project Check the page content and image notes before handoff.

    Card content goes here.

    ``` ### Card frame with footer Put the title and the description in `CardFrameHeader`. Put the buttons in `CardFooter`. ```astro --- import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Textarea } from "@/components/ui/textarea" import { Field, FieldLabel, FieldContent, FieldGroup, } from "@/components/ui/field" import { Card, CardContent, CardFooter, CardFrame, CardFrameDescription, CardFrameHeader, CardFrameTitle, } from "@/components/ui/card" --- Create project Check the page content and image notes before handoff. Project name Project description ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```ts import { Textarea } from "@/components/ui/textarea" ``` ```astro ``` ## API Reference Read the [installed source](/r/textarea.json) for the complete prop types. ## When to use Textarea Use Textarea for messages, notes, and other values that need several lines. Provide a visible label, name, and useful initial height. Put initial text in the default slot as required by native textarea markup. ## Keyboard and behavior Browser editing, selection, form submission, and disabled behavior remain native. Set `aria-invalid` only with a corresponding explanation. Length limits should be stated before the user reaches them. ## Theme and layout The single element owns its surface styles and can grow with content according to its CSS. Check resize behavior and long unbroken text. Use classes for width and height rather than importing a React control wrapper. --- # Theme Toggle for Astro Source: https://ui.gnosticai.com/components/theme-toggle {/* Render in a frame so only the preview theme changes */} ```astro --- import { ThemeToggle } from "@/components/ui/theme-toggle" import ThemeProvider from "@/components/ui/theme-toggle/theme-provider.astro" --- ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/theme-toggle ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. Install the component packages: ```sh bun add @data-slot/core ``` #### src/components/ui/theme-toggle/index.ts ```ts export { default as ThemeToggle } from './theme-toggle.astro' export { default as ThemeProvider } from './theme-provider.astro' export { create, createThemeToggle, setTheme } from './theme-toggle.ts' export type { ThemeToggleController } from './theme-toggle.ts' export type { Theme, ThemeProviderProps, ThemeToggleProps, ThemeEffect, ThemeEffectStart, ThemeEffectVariant, ThemeChangeDetail, ThemeApplyDetail, } from './types.ts' ``` #### src/components/ui/theme-toggle/theme-provider.astro ```astro --- import type { Theme, ThemeProviderProps } from "./types.ts" type Props = ThemeProviderProps const { storageKey = "theme", defaultTheme: defaultThemeProp = "system", storage = "localStorage", attributeType = "both", effect, } = Astro.props let defaultTheme = defaultThemeProp // For SSR only - if page isnt prerendered we can access the cookie from the request if (storage === "cookie" && !Astro.isPrerendered) { const themeCookie = Astro.cookies.get(storageKey)?.value if (themeCookie && ["light", "dark"].includes(themeCookie)) { defaultTheme = themeCookie as Theme } } --- ``` #### src/components/ui/theme-toggle/theme-toggle.astro ```astro --- import type { ComponentProps } from "astro/types" import Moon from "@lucide/astro/icons/moon" import Sun from "@lucide/astro/icons/sun" import { cn } from "cn" import { Button } from "../button/index.ts" import type { ThemeToggleProps } from "./types.ts" type Props = ComponentProps & ThemeToggleProps const { class: className, variant = "ghost", size = "icon-sm", effect, ...props } = Astro.props --- ``` #### src/components/ui/theme-toggle/theme-toggle.ts ```ts import { clearRootBinding, getRootBinding, hasRootBinding, setRootBinding, } from '@data-slot/core' import type { Theme, ThemeToggleProps, ThemeEffect, ThemeEffectStart, ThemeChangeDetail, ThemeApplyDetail, } from './types.ts' export type { ThemeChangeDetail, ThemeApplyDetail } from './types.ts' const BINDING_KEY = '@gnostic/theme-toggle' declare global { interface DocumentEventMap { 'theme:read': CustomEvent<{ theme?: 'light' | 'dark' effect?: ThemeEffect }> 'theme:before-change': CustomEvent 'theme:apply': CustomEvent 'theme:change': CustomEvent } interface HTMLElementEventMap { 'theme:before-change': CustomEvent } } export interface ThemeToggleController { readonly root: HTMLButtonElement readonly theme: 'light' | 'dark' setTheme(theme: Theme, options?: ThemeToggleProps): void toggle(): void destroy(): void } function readTheme(doc: Document) { const detail: DocumentEventMap['theme:read']['detail'] = {} doc.dispatchEvent(new CustomEvent('theme:read', { detail })) if (!detail.theme) throw new Error( 'ThemeProvider is required before using ThemeToggle or setTheme().', ) return { theme: detail.theme, effect: detail.effect } } /** Request a theme change. Listeners can cancel it or set detail.effect. */ export function setTheme( theme: Theme, options: Omit = {}, doc: Document = document, ): void { const provider = readTheme(doc) const effect = options.effect ?? provider.effect const detail: ThemeApplyDetail = { ...options, theme, ...(effect === undefined ? {} : { effect }), } const target = detail.source ?? doc if ( !target.dispatchEvent( new CustomEvent('theme:before-change', { detail, bubbles: true, cancelable: true, }), ) ) return runThemeEffect(doc, detail, () => { doc.dispatchEvent(new CustomEvent('theme:apply', { detail })) if (!detail.resolvedTheme) return doc.dispatchEvent( new CustomEvent('theme:change', { detail, bubbles: true }), ) }) } /** Bind one toggle. Repeated calls return the same controller. */ export function createThemeToggle( root: HTMLButtonElement, options: ThemeToggleProps = {}, ): ThemeToggleController { const existing = getRootBinding(root, BINDING_KEY) if (existing) return existing const doc = root.ownerDocument let destroyed = false let theme = readTheme(doc).theme let effect = options.effect if (effect === undefined && root.dataset.themeEffect) { try { effect = JSON.parse(root.dataset.themeEffect) } catch { /* Use the page default. */ } } const sync = (value = readTheme(doc).theme) => { theme = value const dark = theme === 'dark' root.setAttribute('aria-pressed', String(dark)) root.setAttribute('data-state', dark ? 'on' : 'off') root.toggleAttribute('data-pressed', dark) } const change = (event: DocumentEventMap['theme:change']) => sync(event.detail.resolvedTheme) const observer = new MutationObserver(() => sync()) observer.observe(doc.documentElement, { attributes: true, attributeFilter: ['class', 'data-theme'], }) doc.addEventListener('theme:change', change) const controller: ThemeToggleController = { root, get theme() { return theme }, setTheme(value, overrides = {}) { if (destroyed) return setTheme( value, { ...(effect === undefined ? {} : { effect }), ...overrides, source: root, }, doc, ) }, toggle() { if ( destroyed || root.matches(':disabled') || root.getAttribute('aria-disabled') === 'true' ) return controller.setTheme(theme === 'dark' ? 'light' : 'dark') }, destroy() { if (destroyed) return destroyed = true root.removeEventListener('click', click) doc.removeEventListener('theme:change', change) observer.disconnect() clearRootBinding(root, BINDING_KEY, controller) }, } const click = (event: Event) => { if (!event.defaultPrevented) controller.toggle() } root.addEventListener('click', click) sync() return setRootBinding(root, BINDING_KEY, controller) } /** Bind each unbound toggle within a document or element. */ export function create(scope: ParentNode = document): ThemeToggleController[] { const selector = 'button[data-theme-toggle]' const roots = [...scope.querySelectorAll(selector)] if (scope instanceof Element && scope.matches(selector)) roots.unshift(scope as HTMLButtonElement) return roots .filter((root) => !hasRootBinding(root, BINDING_KEY)) .map((root) => createThemeToggle(root)) } function revealEffect( start: ThemeEffectStart, rect: DOMRect | undefined, view: Window, ) { const positions: Record, string> = { 'top-left': 'inset(0 100% 100% 0)', 'top-right': 'inset(0 0 100% 100%)', 'bottom-left': 'inset(100% 100% 0 0)', 'bottom-right': 'inset(100% 0 0 100%)', center: 'inset(50% 50% 50% 50%)', 'bottom-up': 'inset(100% 0 0 0)', } return { '--theme-effect-from': rect ? `inset(${(rect.top / view.innerHeight) * 100}% ${((view.innerWidth - rect.right) / view.innerWidth) * 100}% ${((view.innerHeight - rect.bottom) / view.innerHeight) * 100}% ${(rect.left / view.innerWidth) * 100}%)` : positions[start === 'toggle' ? 'bottom-up' : start], } } function blastEffect(start: ThemeEffectStart, rect: DOMRect | undefined) { const positions: Record, string> = { 'top-left': '0% 0%', 'top-right': '100% 0%', 'bottom-left': '0% 100%', 'bottom-right': '100% 100%', center: '50% 50%', 'bottom-up': '50% 100%', } return { '--theme-effect-origin': rect ? `${rect.left + rect.width / 2}px ${rect.top + rect.height / 2}px` : positions[start === 'toggle' ? 'bottom-up' : start], } } const effects = { reveal: revealEffect, blast: blastEffect } const active = new WeakMap void>() function runThemeEffect( doc: Document, detail: ThemeChangeDetail, apply: () => void, ): void { active.get(doc)?.() const effect = detail.effect const view = doc.defaultView if ( !effect || !view || view.matchMedia('(prefers-reduced-motion: reduce)').matches || typeof doc.startViewTransition !== 'function' ) { apply() return } const root = doc.documentElement const variant = effect.variant ?? 'reveal' const start = effect.start ?? 'toggle' const rect = start === 'toggle' ? detail.source?.getBoundingClientRect() : undefined const properties = { '--theme-effect-blur': effect.blur ? '8px' : '0px', ...effects[variant](start, rect, view), } for (const [name, value] of Object.entries(properties)) root.style.setProperty(name, value) root.dataset.themeVt = variant let cancelled = false let applied = false let transition: ViewTransition | undefined const update = () => { if (cancelled || applied) return applied = true apply() } const cleanup = () => { doc.removeEventListener('astro:before-swap', cancel) doc.removeEventListener('theme:provider-dispose', cancel) if (active.get(doc) !== cancel) return active.delete(doc) delete root.dataset.themeVt for (const name of Object.keys(properties)) root.style.removeProperty(name) } const cancel = () => { cancelled = true transition?.skipTransition() cleanup() } active.set(doc, cancel) doc.addEventListener('astro:before-swap', cancel, { once: true }) doc.addEventListener('theme:provider-dispose', cancel, { once: true }) try { transition = doc.startViewTransition(update) void transition.ready.catch(() => {}) void transition.finished.then(cleanup, cleanup) } catch { cleanup() update() } } ``` #### src/components/ui/theme-toggle/types.ts ```ts export type Theme = 'light' | 'dark' | 'system' /** * Shape of the theme view transition. * * - `reveal` — a clip grows from the start point to the full viewport * - `blast` — a circle grows outward from the start point */ export type ThemeEffectVariant = 'reveal' | 'blast' /** * Point where a reveal or blast theme transition begins. * * `toggle` uses the theme toggle that was activated. */ export type ThemeEffectStart = | 'toggle' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center' | 'bottom-up' /** Props for a light and dark theme control. */ export interface ThemeToggleProps { /** Override the page effect for this control. Use false to skip it. */ effect?: ThemeEffect | false } /** View transition options shared by the provider and individual controls. */ export interface ThemeEffect { /** * Animation variant. * * @default "reveal" */ variant?: ThemeEffectVariant /** * Where a reveal or blast effect starts. * * @default "toggle" - the coordinate of the theme toggle that was activated */ start?: ThemeEffectStart /** * Blur the new theme as the effect opens. * * @default false */ blur?: boolean } export type ThemeProviderProps = { /** * Default effect for requested theme changes. Omit to change mode without animation. * * @default undefined */ effect?: ThemeEffect /** * The key used in the selected storage. * * @default "theme" */ storageKey?: string /** * The theme to use when no saved preference is found. * * @default "system" */ defaultTheme?: Theme /** * The storage to use for storing the theme preference. * * - `localStorage` - stored in the user's browser until cleared manually * - `sessionStorage` - stored in the user's browser until the session ends (tab closed) * - `cookie` - stored in a session cookie * * @default "localStorage" */ storage?: 'localStorage' | 'sessionStorage' | 'cookie' /** * The attribute type to use to set the theme * * - `attribute` - set the `data-theme` attribute on the root element * - `class` - set a `dark` class on the root element when dark mode is enabled * - `both` - set both `data-theme` and `dark` class on root element * - `none` - emit theme events without changing root attributes * * @default "both" */ attributeType?: 'attribute' | 'class' | 'both' | 'none' } export interface ThemeChangeDetail extends ThemeToggleProps { theme: Theme source?: HTMLElement disableTransitions?: boolean } export interface ThemeApplyDetail extends ThemeChangeDetail { /** Set by the provider after it applies the requested theme. */ resolvedTheme?: 'light' | 'dark' } ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Setup The theme toggle requires one `ThemeProvider` in your document's ``. The provider applies the initial mode before the page appears and saves theme preferences. The toggle and browser API report an error when no provider is present. Add the provider to your layout's head section: ```astro --- import { ThemeProvider } from "@/components/ui/theme-toggle" --- ``` Render `ThemeProvider` before the visible page. Its inline script applies the initial theme early, using the approach documented in the shadcn Astro dark mode guide. ## Usage ```ts import { ThemeToggle } from "@/components/ui/theme-toggle" ``` ```astro ``` ## Examples ### Use Cookie storage The `ThemeProvider` allows customizing the storage mechanism for the theme preference. ```astro --- import { ThemeProvider } from "@/components/ui/theme-toggle" --- ``` ### View transition Set `effect` on the existing `ThemeProvider` to choose the default view transition. The prop defaults to `undefined`, so mode changes have no animation unless the provider or a toggle supplies an effect. The provider includes the transition styles; they apply only while `data-theme-vt` is set on the document root. ```astro --- import { ThemeProvider, ThemeToggle } from "@/components/ui/theme-toggle" --- ``` ```astro --- import { ThemeProvider, ThemeToggle } from "@/components/ui/theme-toggle" --- ``` `reveal` opens a clip from the start point. `blast` grows a circle from that point. Set `blur` to soften the new theme as the effect opens. ```astro ``` `start: "toggle"` uses the toggle that was clicked. The other start values are `top-left`, `top-right`, `bottom-left`, `bottom-right`, `center`, and `bottom-up`. The effect is skipped when the browser has no View Transitions API, and when the user prefers reduced motion. Each toggle can override the provider effect. Omit the prop to inherit the provider setting. Use `false` to skip it: ```astro ``` ### Browser API and events The component binds a click listener to each button. It does not listen for clicks on the document. It binds new page controls after Astro navigation and removes its listeners before a page swap. The provider also removes its listeners on `astro:before-swap`, before Astro replaces the page during client navigation. `theme:before-change` runs before a requested mode change. A mode change does not replace the page. Each provider run sends the internal `theme:provider-dispose` event. The old provider uses it to remove its listeners. The transition runner uses it to cancel a pending animation. This prevents duplicate listeners and an old animation from changing the mode after the provider has been replaced. Application code does not need to send this event. Import browser functions from `theme-toggle.ts`: ```astro ``` `create(scope)` returns only the controllers it creates. `createThemeToggle(button)` returns an existing controller when the button is already bound. Each controller has `theme`, `setTheme()`, `toggle()`, and `destroy()`. | Event | Purpose | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `theme:before-change` | Bubbles from the source button, or fires on the document for `setTheme()`. Call `preventDefault()` to cancel. Set `detail.effect` to choose an effect for this change. | | `theme:apply` | Runs on the document inside the transition update. The provider applies and saves `detail.theme`, then sets `detail.resolvedTheme`. | | `theme:change` | Runs on the document after the theme is applied. All toggles update their state. | Event detail includes `theme`, optional `source`, and optional `effect`. `theme:change` also includes `resolvedTheme` (`light` or `dark`). The events do not stop other listeners. Use `setTheme()` or a controller to request a change through the full event sequence. ```ts document.addEventListener("theme:before-change", (event) => { if (event.detail.source?.id === "color-mode") { event.detail.effect = { variant: "blast", start: "toggle", blur: true } } }) document.addEventListener("theme:change", (event) => { console.log(event.detail.resolvedTheme) }) ``` ### Alternate Icon Pass icons in the slot. Use `dark:hidden` on the light icon and `hidden dark:block` on the dark icon when the two marks differ. ```astro --- import { ThemeProvider, ThemeToggle } from "@/components/ui/theme-toggle" --- ``` ## Notes - `ThemeToggle` is a two-state light and dark switch. - `ThemeProvider` reads the saved preference first and falls back to the `defaultTheme`. The default value, `system`, follows the system color scheme. - If you need a richer theme picker, build that separately on top of the same `.dark` class convention. ## API Reference ### ThemeToggleProps ### ThemeProviderProps ### ThemeEffect Options for the provider's `effect` prop and per-toggle overrides. This is a type, not a component. ## When to use Theme Toggle Use ThemeToggle where a user can change the page color mode. Keep its control in a stable location, such as the header. It changes color mode rather than choosing a complete palette. ## Keyboard and behavior Give the control a useful accessible name and check keyboard activation. Verify the chosen mode after page navigation. The rest of the page must also use theme tokens for the change to remain consistent. ## Theme and layout Check images, borders, and focus rings in both modes. Fixed light backgrounds in page content can defeat the theme even when the toggle itself works. --- # Toast for Astro Source: https://ui.gnosticai.com/components/toast ```astro --- import { Button } from "@/components/ui/button" import { Toast } from "@/components/ui/toast" ---
    ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/toast ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. Install the component packages: ```sh bun add @data-slot/toast ``` #### src/components/ui/toast/index.ts ```ts export { default as Toast } from './toast.astro' export { default as ToastAction } from './toast-action.astro' export { default as ToastClose } from './toast-close.astro' export { default as ToastContent } from './toast-content.astro' export { default as ToastDescription } from './toast-description.astro' export { default as ToastIcon } from './toast-icon.astro' export { default as ToastItem } from './toast-item.astro' export { default as ToastTemplate } from './toast-template.astro' export { default as ToastTitle } from './toast-title.astro' export { default as ToastViewport } from './toast-viewport.astro' export type { ToastProps } from './types.ts' ``` #### src/components/ui/toast/toast-action.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import { buttonVariants } from "../button/button-variants.ts" type Props = HTMLAttributes<"button"> const { class: className, type = "button", ...props } = Astro.props --- ``` #### src/components/ui/toast/toast-close.astro ```astro --- import type { HTMLAttributes } from "astro/types" import XIcon from "@lucide/astro/icons/x" import { cn } from "cn" type Props = HTMLAttributes<"button"> const { class: className, type = "button", "aria-label": label = "Close notification", ...props } = Astro.props --- ``` #### src/components/ui/toast/toast-content.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/toast/toast-description.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/toast/toast-icon.astro ```astro --- import type { HTMLAttributes } from "astro/types" import CircleAlertIcon from "@lucide/astro/icons/circle-exclamation-point" import CircleCheckIcon from "@lucide/astro/icons/circle-check" import InfoIcon from "@lucide/astro/icons/info" import LoaderCircleIcon from "@lucide/astro/icons/loader-circle" import TriangleAlertIcon from "@lucide/astro/icons/triangle-exclamation-point" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props --- ``` #### src/components/ui/toast/toast-item.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"li"> const { class: className, ...props } = Astro.props ---
  • ``` #### src/components/ui/toast/toast-template.astro ```astro --- import { cn } from "cn" import ToastAction from "./toast-action.astro" import ToastClose from "./toast-close.astro" import ToastContent from "./toast-content.astro" import ToastDescription from "./toast-description.astro" import ToastIcon from "./toast-icon.astro" import ToastItem from "./toast-item.astro" import ToastTitle from "./toast-title.astro" type Props = astroHTML.JSX.HTMLAttributes const { class: className, ...props } = Astro.props --- ``` #### src/components/ui/toast/toast-title.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"div"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/toast/toast-viewport.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"ol"> const { class: className, "aria-label": label = "Notifications", ...props } = Astro.props ---
    ``` #### src/components/ui/toast/toast.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import ToastTemplate from "./toast-template.astro" import ToastViewport from "./toast-viewport.astro" import type { ToastProps } from "./types.ts" type Props = HTMLAttributes<"div"> & ToastProps const { class: className, position = "bottom-right", limit = 3, duration = 5000, pauseOnHover = true, pauseOnFocus = true, portal = true, ...props } = Astro.props ---
    ``` #### src/components/ui/toast/types.ts ```ts import type { ToastPosition } from '@data-slot/toast' import type { ToastShowOptions as ToastShowOptionsType, ToastAction as ToastActionType, ToastUpdateOptions as ToastUpdateOptionsType, ToastPromiseOptions as ToastPromiseOptionsType, ToastOptions as ToastOptionsType, } from '@data-slot/toast' export type ToastAction = ToastActionType export type ToastUpdateOptions = ToastUpdateOptionsType export type ToastPromiseOptions = ToastPromiseOptionsType export type ToastOptions = ToastOptionsType export type ToastShowOptions = ToastShowOptionsType /** Options for a notification stack. */ export interface ToastProps { /** * Position of the stack in the page viewport. * @default "bottom-right" */ position?: ToastPosition /** * Maximum number of visible notifications. * @default 3 */ limit?: number /** * Time before dismissal, in milliseconds. Use 0 to keep a toast open. * @default 5000 */ duration?: number /** * Pause dismissal while the pointer is over the stack. * @default true */ pauseOnHover?: boolean /** * Pause dismissal while focus is inside the stack. * @default true */ pauseOnFocus?: boolean /** * Move the viewport to document.body to escape clipping containers. * @default true */ portal?: boolean } ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage Place one `Toast` in your layout. It supplies the template, status icons, close button, and notification viewport. Its script initializes the data-slot controller. ```astro --- import { Toast } from "@/components/ui/toast" --- ``` Call `show()` from your application event handler after the root is in the document. `createToast(root)` returns the existing controller when the root is already initialized. Each root has an independent stack. With Astro navigation, find the current root before you use the controller; the component destroys its old controllers before a page swap. ## Examples ### With an action An action dismisses its toast after the callback runs. Call `event.preventDefault()` in the callback to keep it open. ```astro --- import { Button } from "@/components/ui/button" import { Toast } from "@/components/ui/toast" ---
    ``` ### Promise states Use `promise()` to change one notification from loading to success or error. The examples simulate a request. Call the returned handle's `unwrap()` when your application also needs the result or error. ```astro --- import { Button } from "@/components/ui/button" import { Toast } from "@/components/ui/toast" ---
    ``` ### Position Use `position` to select one of six viewport positions. Notifications expand when hovered or focused. Older notifications remain mounted but become hidden and inert when the visible limit is exceeded. ```astro --- import type { ToastPosition } from "@data-slot/toast" import { Button } from "@/components/ui/button" import { Toast } from "@/components/ui/toast" const positions: ToastPosition[] = [ "top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right", ] ---
    {positions.map((position) => ( <> ))}
    ``` ## Custom template The default slot replaces both the template and viewport. Keep one `ToastTemplate` and one `ToastViewport` inside the root. `ToastTemplate` has its own default content, which you can replace with the exported parts: ```astro ``` Import these parts from `@/components/ui/toast`. The primitive fills the title, description, and action with text. It hides an empty description or action. Keep these slots free of child markup that must survive an update. Avoid fixed IDs inside the template because each notification clones it. ## API reference ### ToastProps ### ToastShowOptions ### ToastUpdateOptions ### ToastAction ### ToastPromiseOptions Other parts accept their native HTML attributes and `class`. `ToastViewport` is an ordered list. `ToastItem` is a list item. `ToastAction` and `ToastClose` are buttons. `ToastIcon` supplies the status icons, including the loading indicator. ### Events Dispatch these events on the toast root. The root emits the outbound events. #### Outbound events | Event | Detail | | -------------- | --------------------------------------------- | | `toast:change` | `{ id: string, action: "show" \| "dismiss" }` | | `toast:action` | `{ id: string, value: string \| undefined }` | #### Inbound events | Event | Detail | | --------------- | ------------------------------------- | | `toast:show` | `ToastShowOptions` | | `toast:update` | `{ id: string } & ToastUpdateOptions` | | `toast:dismiss` | `{ id: string }` or `string` | | `toast:clear` | none | ### Controller Import `createToast` and controller types from `@data-slot/toast`. Use `show`, `update`, `promise`, `dismiss`, and `dismissAll` to control notifications. A repeated `show()` ID replaces the old toast; `update(id, patch)` changes it in place. Set `duration: 0` to keep a notification open until dismissed. The root also accepts `toast:show`, `toast:update`, `toast:dismiss`, and `toast:clear` custom events. It emits `toast:change` and `toast:action`. See the [data-slot Toast API](https://data-slot.com/components/toast/) for options and event details. Read the [installed source](/r/toast.json) for all exported parts. ## Accessibility and limits The primitive announces errors and warnings as alerts. Other notifications use polite status announcements. Keep essential errors next to the affected field as well. Timers pause on hover, focus, window blur, and a hidden document. Users can close a toast with its labeled button or a swipe. `dismissible: false` disables swiping; it does not remove the close button. The styles adapt [Coss Toast](https://coss.com/ui/docs/components/toast) to Astro and data-slot. This component uses the data-slot API. Anchored toasts, Base UI providers, F6 viewport focus, and Escape dismissal are not supplied. Animation follows the reduced-motion preference. `portal` defaults to `true` in this Astro component, so the viewport can escape clipping containers. The primitive itself defaults to `false`. Set `portal={false}` to retain the viewport in its original parent; it still uses fixed positioning unless you supply a different layout class. ## Theme and layout Toast styles use the project preset. Keep messages short enough to read at phone widths, and choose a viewport position that does not cover the main page action. Portalled toasts can escape clipping containers. Use an [Alert](/components/alert) for feedback that must remain in the page content. --- # Table of contents for Astro Source: https://ui.gnosticai.com/components/toc ## Usage ```ts import { Toc, TocMenu, TocMenuItem, TocMenuLink, TocTitle } from "@/components/ui/toc" ``` ```astro --- import { Toc, TocMenu, TocMenuItem, TocMenuLink, TocTitle, } from "@/components/ui/toc" --- On This Page Installation Usage Basic ``` ## Examples ```astro --- import { Toc, TocMenu, TocMenuItem, TocMenuLink, TocTitle, } from "@/components/ui/toc" --- On This Page Installation Usage Examples ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/toc ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. No extra packages are required. #### src/components/ui/toc/index.ts ```ts export { default as Toc } from "./toc.astro" export { default as TocMenu } from "./toc-menu.astro" export { default as TocMenuItem } from "./toc-menu-item.astro" export { default as TocMenuLink } from "./toc-menu-link.astro" export { default as TocTitle } from "./toc-title.astro" ``` #### src/components/ui/toc/toc-menu-item.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"li"> const { class: className, ...props } = Astro.props ---
  • ``` #### src/components/ui/toc/toc-menu-link.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"a"> & { depth?: number isActive?: boolean active?: boolean } const { class: className, depth = 2, isActive, active = false, ...props } = Astro.props const resolvedActive = isActive ?? active --- = 4 && "pl-8", className, )} {...props} > ``` #### src/components/ui/toc/toc-menu.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"ul"> const { class: className, ...props } = Astro.props ---
    ``` #### src/components/ui/toc/toc-title.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"p"> & HTMLAttributes<"h2"> & HTMLAttributes<"div"> & { as?: "p" | "h2" | "div" } const { as: Tag = "p", class: className, ...props } = Astro.props --- ``` #### src/components/ui/toc/toc.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" type Props = HTMLAttributes<"nav"> const { class: className, ...props } = Astro.props --- ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ### Custom Title You can choose any wrapper label and compose the structure yourself. ```astro --- import { Toc, TocMenu, TocMenuItem, TocMenuLink, TocTitle, } from "@/components/ui/toc" --- Contents Installation Usage Custom Title ``` ## API Reference Read the [installed source](/r/toc.json) for the complete prop types. ## When to use Toc Build Toc links from the headings the page actually renders. Give each target a stable ID and use concise link text. Keep nesting aligned with the heading hierarchy. ## Keyboard and behavior Links use native fragment navigation. The component does not discover headings from arbitrary content. Check that sticky page headers do not hide the target heading after navigation. ## Theme and layout Set a readable width for long section names and avoid excessive nesting. Shared text and border colors keep the contents list distinct without competing with the article. --- # Toggle for Astro Source: https://ui.gnosticai.com/components/toggle ```astro --- import BoldIcon from "@lucide/astro/icons/letter-b" import { Toggle } from "@/components/ui/toggle" --- ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/toggle ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. Install the component packages: ```sh bun add @data-slot/toggle ``` #### src/components/ui/toggle/index.ts ```ts export { default as Toggle } from './toggle.astro' export { toggleVariants } from './toggle-variants' export type { ToggleVariantProps } from './toggle-variants' export type { ToggleProps } from './types.ts' ``` #### src/components/ui/toggle/toggle-variants.ts ```ts import { cva, type VariantProps } from 'class-variance-authority' import { cn } from 'cn' /** Shared layout, type, and pressed styles for Toggle and Toggle Group items. */ export const toggleBaseClass = "text-foreground hover:bg-accent focus-visible:ring-ring focus-visible:ring-offset-background aria-pressed:bg-input/64 aria-pressed:text-accent-foreground relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-lg border text-base font-medium whitespace-nowrap transition-shadow outline-none select-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-64 sm:text-sm pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 [&_svg]:pointer-events-none [&_svg]:-mx-0.5 [&_svg]:shrink-0 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 group/toggle" /** Height and padding for each Toggle size. */ export const toggleSizeClass = { default: "h-9 min-w-9 px-[calc(--spacing(2)-1px)] sm:h-8 sm:min-w-8", lg: "h-10 min-w-10 px-[calc(--spacing(2.5)-1px)] sm:h-9 sm:min-w-9", sm: "h-8 min-w-8 px-[calc(--spacing(1.5)-1px)] sm:h-7 sm:min-w-7", } as const /** Border and surface treatment for each Toggle variant. */ export const toggleVariantClass = { default: "border-transparent", outline: "border-input bg-background dark:bg-input/32 dark:aria-pressed:bg-input dark:hover:bg-input/64 shadow-xs/5 not-dark:bg-clip-padding not-disabled:not-active:not-aria-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:not-disabled:not-aria-pressed:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-aria-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[aria-pressed=true]]:shadow-none", } as const const toggleStyles = cva(toggleBaseClass, { defaultVariants: { size: 'default', variant: 'default', }, variants: { size: toggleSizeClass, variant: toggleVariantClass, }, }) export const toggleVariants = (...args: Parameters) => cn(toggleStyles(...args)) export type ToggleVariantProps = VariantProps ``` #### src/components/ui/toggle/toggle.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import { toggleVariants } from "./toggle-variants" import type { ToggleProps } from "./types.ts" type Props = HTMLAttributes<"button"> & ToggleProps const { class: className, variant = "default", size = "default", defaultPressed, disabled, type = "button", ...props } = Astro.props --- ``` #### src/components/ui/toggle/types.ts ```ts import type { ToggleOptions } from '@data-slot/toggle' import type { ToggleVariantProps } from './toggle-variants.ts' /** * Toggle initial state, visual variant, and size. Button attributes pass through. */ export type ToggleProps = Pick & ToggleVariantProps ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```astro --- import { Toggle } from "@/components/ui/toggle" --- ``` ```astro Toggle ``` ## Examples ```astro --- import ItalicIcon from "@lucide/astro/icons/italic" import { Toggle } from "@/components/ui/toggle" --- ``` ```astro --- import BoldIcon from "@lucide/astro/icons/letter-b" import ItalicIcon from "@lucide/astro/icons/italic" import UnderlineIcon from "@lucide/astro/icons/underline" import { Toggle } from "@/components/ui/toggle" ---
    ``` ```astro --- import UnderlineIcon from "@lucide/astro/icons/underline" import { Toggle } from "@/components/ui/toggle" --- ``` ## Sizes and states ```astro --- import { Toggle } from "@/components/ui/toggle" ---
    {(["sm", "default", "lg"] as const).map((size) => (
    Grid lines Guides Locked
    ))}
    ``` ## API Reference ### ToggleProps See the [data-slot docs](https://github.com/bejamas/data-slot/blob/main/packages/toggle/README.md) for more information on interactivity. ### Events Dispatch these events on the toggle root. The root emits the outbound events. #### Outbound events | Event | Detail | | --------------- | ---------------------- | | `toggle:change` | `{ pressed: boolean }` | #### Inbound events | Event | Detail | | ------------ | -------------------- | | `toggle:set` | `{ value: boolean }` | Read the [installed source](/r/toggle.json) for the complete prop types. ## When to use Toggle Use Toggle for a mode or action that stays pressed, such as a formatting option. Keep the label stable so the pressed state carries the change. Use the existing size and outline variants for density and grouping. ## Keyboard and behavior The data-slot controller updates `aria-pressed` and handles keyboard activation. A toggle does not save application data automatically. Use Toggle Group when adjacent toggles share a selection. ## Theme and layout Pressed, hover, focus, and disabled styles use the current theme. Check an icon-only toggle with an accessible name. Color should reinforce the pressed state, not be its only indication. --- # Toggle Group for Astro Source: https://ui.gnosticai.com/components/toggle-group ```astro --- import AlignCenterIcon from "@lucide/astro/icons/text-align-center" import AlignLeftIcon from "@lucide/astro/icons/text-align-start" import AlignRightIcon from "@lucide/astro/icons/text-align-end" import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group" --- ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/toggle-group ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. Install the component packages: ```sh bun add @data-slot/toggle-group ``` #### src/components/ui/toggle-group/index.ts ```ts export { default as ToggleGroup } from './toggle-group.astro' export { default as ToggleGroupItem } from './toggle-group-item.astro' export { default as ToggleGroupSeparator } from './toggle-group-separator.astro' export { toggleGroupItemVariants, toggleGroupVariants, type ToggleGroupItemVariantProps, type ToggleGroupVariantProps, } from './toggle-group-variants.ts' export type { ToggleGroupItemProps, ToggleGroupProps, ToggleGroupSeparatorProps, } from './types.ts' ``` #### src/components/ui/toggle-group/toggle-group-item.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import { toggleGroupItemVariants } from "./toggle-group-variants.ts" import type { ToggleGroupItemProps } from "./types.ts" /** Button attributes pass through. `value` is required by `ToggleGroupItemProps`. */ type Props = Omit, "value"> & ToggleGroupItemProps const { class: className, value, variant, size, disabled, type = "button", ...props } = Astro.props --- ``` #### src/components/ui/toggle-group/toggle-group-separator.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import { Separator } from "../separator/index.ts" import type { ToggleGroupSeparatorProps } from "./types.ts" /** Separator attributes pass through. */ type Props = HTMLAttributes<"div"> & ToggleGroupSeparatorProps const { class: className, orientation = "vertical", ...props } = Astro.props --- ``` #### src/components/ui/toggle-group/toggle-group-variants.ts ```ts import { cva, type VariantProps } from 'class-variance-authority' import { cn } from 'cn' import { toggleBaseClass, toggleSizeClass, toggleVariantClass, } from '../toggle/toggle-variants.ts' /** * Layout for the group. * `outline` joins direct children and paints the Toggle outline treatment * on each item that does not set `data-variant`. * `size` paints the Toggle size on each item that does not set `data-size`. * The default variant keeps a small gap. * Separator rules follow the pressed and hover state of a neighboring item. * `disabled` blocks pointer events on each item. */ const toggleGroupStyles = cva("dark:*:[[data-slot=separator]:has(+[data-slot=toggle-group-item]:hover)]:before:bg-input/64 dark:*:[[data-slot=separator]:has(+[data-slot=toggle-group-item][aria-pressed=true])]:before:bg-input dark:*:[[data-slot=toggle-group-item]:hover+[data-slot=separator]]:before:bg-input/64 dark:*:[[data-slot=toggle-group-item][aria-pressed=true]+[data-slot=separator]]:before:bg-input flex w-fit *:focus-visible:z-10 group/toggle-group", { compoundVariants: [ { class: "*:not-first:rounded-s-none *:not-first:border-s-0 *:not-last:rounded-e-none *:not-last:border-e-0 *:not-first:before:rounded-s-none *:not-last:before:rounded-e-none *:not-first:not-data-[slot=separator]:before:inset-s-[-0.5px] *:not-last:not-data-[slot=separator]:before:inset-e-[-0.5px]", orientation: 'horizontal', variant: 'outline', }, { class: "*:not-first:rounded-t-none *:not-first:border-t-0 *:not-last:rounded-b-none *:not-last:border-b-0 *:not-first:before:rounded-t-none *:not-last:before:rounded-b-none *:not-first:not-data-[slot=separator]:before:top-[-0.5px] *:not-last:not-data-[slot=separator]:before:bottom-[-0.5px] *:data-[slot=toggle-group-item]:not-last:before:hidden dark:*:first:before:block dark:*:last:before:hidden", orientation: 'vertical', variant: 'outline', }, ], defaultVariants: { disabled: false, orientation: 'horizontal', size: 'default', variant: 'default', }, variants: { disabled: { false: '', true: 'cursor-not-allowed *:data-[slot=toggle-group-item]:pointer-events-none *:data-[slot=toggle-group-item]:opacity-64', }, orientation: { horizontal: '*:pointer-coarse:after:min-w-auto', vertical: 'flex-col *:pointer-coarse:after:min-h-auto', }, size: { default: "*:data-[slot=toggle-group-item]:not-data-size:h-9 *:data-[slot=toggle-group-item]:not-data-size:min-w-9 *:data-[slot=toggle-group-item]:not-data-size:px-[calc(--spacing(2)-1px)] *:data-[slot=toggle-group-item]:not-data-size:sm:h-8 *:data-[slot=toggle-group-item]:not-data-size:sm:min-w-8", lg: "*:data-[slot=toggle-group-item]:not-data-size:h-10 *:data-[slot=toggle-group-item]:not-data-size:min-w-10 *:data-[slot=toggle-group-item]:not-data-size:px-[calc(--spacing(2.5)-1px)] *:data-[slot=toggle-group-item]:not-data-size:sm:h-9 *:data-[slot=toggle-group-item]:not-data-size:sm:min-w-9", sm: "*:data-[slot=toggle-group-item]:not-data-size:h-8 *:data-[slot=toggle-group-item]:not-data-size:min-w-8 *:data-[slot=toggle-group-item]:not-data-size:px-[calc(--spacing(1.5)-1px)] *:data-[slot=toggle-group-item]:not-data-size:sm:h-7 *:data-[slot=toggle-group-item]:not-data-size:sm:min-w-7", }, variant: { default: "gap-0.5 *:data-[slot=toggle-group-item]:not-data-variant:border-transparent", outline: "*:data-[slot=toggle-group-item]:not-data-variant:border-input *:data-[slot=toggle-group-item]:not-data-variant:bg-background *:data-[slot=toggle-group-item]:not-data-variant:hover:bg-accent *:data-[slot=toggle-group-item]:not-data-variant:aria-pressed:bg-input/64 *:data-[slot=toggle-group-item]:not-data-variant:dark:bg-input/32 *:data-[slot=toggle-group-item]:not-data-variant:dark:aria-pressed:bg-input *:data-[slot=toggle-group-item]:not-data-variant:dark:hover:bg-input/64 *:data-[slot=toggle-group-item]:not-data-variant:shadow-xs/5 *:data-[slot=toggle-group-item]:not-data-variant:not-dark:bg-clip-padding *:data-[slot=toggle-group-item]:not-data-variant:not-disabled:not-active:not-aria-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] *:data-[slot=toggle-group-item]:not-data-variant:dark:not-disabled:not-aria-pressed:before:shadow-[0_-1px_--theme(--color-white/2%)] *:data-[slot=toggle-group-item]:not-data-variant:dark:not-disabled:not-active:not-aria-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] *:data-[slot=toggle-group-item]:not-data-variant:[:disabled,:active,[aria-pressed=true]]:shadow-none", }, }, }) export const toggleGroupVariants = ( ...args: Parameters ) => cn(toggleGroupStyles(...args)) export type ToggleGroupVariantProps = VariantProps /** * Styles for one item. * `variant` and `size` use the Toggle classes. * Pass `null` for an omitted value. The group variant then owns that axis. */ const toggleGroupItemStyles = cva(`${toggleBaseClass} aria-pressed:z-10`, { variants: { size: toggleSizeClass, variant: toggleVariantClass, }, }) export const toggleGroupItemVariants = ( ...args: Parameters ) => cn(toggleGroupItemStyles(...args)) export type ToggleGroupItemVariantProps = VariantProps< typeof toggleGroupItemVariants > ``` #### src/components/ui/toggle-group/toggle-group.astro ```astro --- import type { HTMLAttributes } from "astro/types" import { cn } from "cn" import type { ToggleGroupProps } from "./types.ts" import { toggleGroupVariants } from "./toggle-group-variants.ts" /** Div attributes pass through. Give the group an accessible name. */ type Props = HTMLAttributes<"div"> & ToggleGroupProps const { class: className, variant = "default", size = "default", orientation = "horizontal", defaultValue, multiple, loop, disabled, ...props } = Astro.props /** * The controller reads a space-separated list. * An array and a string with spaces become that list. */ const defaultValueAttribute = Array.isArray(defaultValue) ? defaultValue .flatMap((value) => value.split(/\s+/)) .filter((value) => value.length > 0) .join(" ") : defaultValue ---
    ``` #### src/components/ui/toggle-group/types.ts ```ts import type { ToggleVariantProps } from '../toggle/toggle-variants.ts' /** * Props for a set of toggle buttons that share a selection. * Div attributes such as `class`, `id`, and `aria-label` pass through. * Give the group an accessible name with `aria-label` or `aria-labelledby`. * Place each item directly inside the group. A separator may sit between items. */ export interface ToggleGroupProps { /** * Visual style for every item that does not set its own `variant`. * `outline` joins the items into one control. The default style leaves a small gap. * * @default "default" */ variant?: ToggleVariantProps['variant'] /** * Height and padding for every item that does not set its own `size`. * * @default "default" */ size?: ToggleVariantProps['size'] /** * Direction of the items and of the arrow keys. * * @default "horizontal" */ orientation?: 'horizontal' | 'vertical' /** * Value selected at first render. * Pass one value, a space-separated list, or an array. * A value matches an item `value`. Use a value with no spaces. * In single selection, the first known value is selected. */ defaultValue?: string | string[] /** * Allow more than one pressed item. * * @default false */ multiple?: boolean /** * Move focus from the last item to the first item, and the reverse. * * @default true */ loop?: boolean /** * Block changes to every item. * * @default false */ disabled?: boolean } /** * Props for one toggle in the group. * Button attributes such as `class` and `aria-label` pass through. * The control is its own button. It uses the Toggle styles. */ export interface ToggleGroupItemProps { /** * Value stored for this item. * The group matches this value against `defaultValue`. * Use a value with no spaces. */ value: string /** * Visual style for this item. * When omitted, the item uses the group's `variant`. */ variant?: ToggleVariantProps['variant'] /** * Control size for this item. * When omitted, the item uses the group's `size`. */ size?: ToggleVariantProps['size'] /** * Block changes to this item. * * @default false */ disabled?: boolean } /** * Props for a divider between toggle group items. * Separator attributes such as `class` pass through. */ export interface ToggleGroupSeparatorProps { /** * Direction of the divider line. * Use `vertical` between items in a horizontal group. * Use `horizontal` between items in a vertical group. * * @default "vertical" */ orientation?: 'horizontal' | 'vertical' } ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```astro --- import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group" --- ``` ```astro index.astro wrap lineNumbers Left Center Right ``` Set `multiple` when more than one item can stay pressed. Pass several values as an array or as a space-separated string. ```astro index.astro wrap lineNumbers Bold Italic Underline ``` `variant` and `size` on the group apply to each item that does not set its own value. `outline` joins the items. The default variant leaves a small gap. Each item uses the [Toggle](/components/toggle) styles. ## Composition Place the parts directly inside `ToggleGroup`: ```text ToggleGroup ├── ToggleGroupItem ├── ToggleGroupSeparator └── ToggleGroupItem ``` `ToggleGroupSeparator` is optional. Use `orientation="horizontal"` on the separator when the group is vertical. ## Examples ### Several selections ```astro --- import BoldIcon from "@lucide/astro/icons/letter-b" import ItalicIcon from "@lucide/astro/icons/italic" import UnderlineIcon from "@lucide/astro/icons/underline" import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group" --- ``` ### Disabled `disabled` on the group blocks every item. `disabled` on one item blocks that item. ```astro --- import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group" ---
    Left Center Right Left Center Right
    ``` ### Sizes ```astro --- import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group" ---
    {(["sm", "default", "lg"] as const).map((size) => ( Left Center Right ))}
    ``` ### Vertical ```astro --- import { ToggleGroup, ToggleGroupItem, ToggleGroupSeparator, } from "@/components/ui/toggle-group" --- Start Center End ``` ## API Reference ### ToggleGroupProps Div attributes such as `class`, `id`, and `aria-label` pass through. ### ToggleGroupItemProps Button attributes such as `class` and `aria-label` pass through. Give an icon-only item an accessible name. ### ToggleGroupSeparatorProps Separator attributes such as `class` pass through. See the [data-slot docs](https://data-slot.com/components/toggle-group/) for the controller, events, and keyboard model. ### Events Dispatch these events on the toggle group root. The root emits the outbound events. `detail.value` is an array of strings, including when the group allows one selection. #### Outbound events | Event | Detail | | --------------------- | --------------------- | | `toggle-group:change` | `{ value: string[] }` | #### Inbound events | Event | Detail | | ------------------ | ------------------------------- | | `toggle-group:set` | `{ value: string \| string[] }` | Read the [installed source](/r/toggle-group.json) for the component source. ## When to use Toggle Group Use Toggle Group when the visitor keeps one option pressed, or several options pressed, and every option stays visible. Put the group label in `aria-label` when nearby text does not name the group. Use one item value with no spaces. ## Keyboard and behavior Tab moves to the active item. Arrow keys move focus along `orientation`. Home moves to the first item. End moves to the last item. Enter and Space press the focused item. Set `loop={false}` to stop focus at the ends. One item stays pressed at a time unless `multiple` is set. Press the active item again to clear it. A disabled group and a disabled item ignore pointer and keyboard changes. ## Theme and layout Pressed, hover, focus, and disabled styles use the Toggle variants and the current theme. Check an icon-only item with an accessible name. In an outline group, keep item sizes equal so the shared border stays even. Color should reinforce the pressed state, not be its only indication. --- # Tooltip for Astro Source: https://ui.gnosticai.com/components/tooltip ```astro --- import { buttonVariants } from "@/components/ui/button" import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip" --- Show Tooltip Add to project ``` ## Installation ### Command ```sh bunx --bun shadcn@latest add @gnostic/tooltip ``` ### Manual Complete the [Installation guide](/docs/installation) first. Then copy the component files below. Install the component packages: ```sh bun add @data-slot/tooltip ``` #### src/components/ui/tooltip/index.ts ```ts export { default as Tooltip } from "./tooltip.astro" export { default as TooltipContent } from "./tooltip-content.astro" export { default as TooltipTrigger } from "./tooltip-trigger.astro" ``` #### src/components/ui/tooltip/tooltip-content.astro ```astro --- import type { HTMLAttributes } from "astro/types" import type { TooltipContentProps } from "./types" import { cn } from "cn" type Props = HTMLAttributes<"div"> & TooltipContentProps const { class: className, hidden = true, side, align, sideOffset, alignOffset, avoidCollisions, collisionPadding, ...props } = Astro.props ---
    ``` #### src/components/ui/tooltip/tooltip-trigger.astro ```astro --- import type { HTMLAttributes, HTMLTag, Polymorphic } from "astro/types" import { cn } from "cn" type Props = Polymorphic<{ as: T }> & HTMLAttributes const { as: explicitTag, class: className, ...props } = Astro.props const Tag = explicitTag || ("href" in Astro.props ? "a" : "button") const elementProps: Record = { ...props } elementProps.type = Tag === "button" ? elementProps.type || "button" : undefined --- ``` #### src/components/ui/tooltip/tooltip.astro ```astro --- import type { HTMLAttributes } from "astro/types" import type { TooltipProps } from "./types" import { cn } from "cn" type Props = HTMLAttributes<"div"> & TooltipProps const { class: className, delay = 300, skipDelayDuration = 300, side = "top", align = "center", sideOffset = 4, alignOffset = 0, mountStrategy = "lazy", avoidCollisions = true, collisionPadding = 8, portal = true, ...props } = Astro.props ---
    ``` #### src/components/ui/tooltip/types.ts ```ts import type { TooltipOptions } from '@data-slot/tooltip' /** Tooltip configuration rendered as data attributes. */ export type TooltipProps = Pick< TooltipOptions, | 'delay' | 'skipDelayDuration' | 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'mountStrategy' | 'avoidCollisions' | 'collisionPadding' | 'portal' > export type TooltipContentProps = Pick< TooltipOptions, | 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'avoidCollisions' | 'collisionPadding' > ``` Component classes use the preset configured during project setup. Select the same preset in the docs before copying Manual source. To change installed component classes, edit or reinstall their source. See [Theming](/docs/theming) for details. ## Usage ```ts import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip" ``` ```astro Show Tooltip Add to project ``` ## Composition Arrange the parts as shown for a `Tooltip`: ```text Tooltip ├── TooltipTrigger └── TooltipContent ``` ## Examples ### Tooltip Sides Control the position of the tooltip with the `side` prop. ```astro --- import { buttonVariants } from "@/components/ui/button" import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip" ---
    Top Top tooltip Bottom Bottom tooltip Left Left tooltip Right Right tooltip
    ``` ## API Reference ### TooltipProps ### TooltipContentProps See the [data-slot docs](https://github.com/bejamas/data-slot/blob/main/packages/tooltip/README.md) for more information on interactivity. ### Events Dispatch these events on the tooltip root. The root emits the outbound events. #### Outbound events | Event | Detail | | ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | | `tooltip:change` | `{ open: boolean, trigger: HTMLElement, content: HTMLElement, reason: "pointer" \| "focus" \| "blur" \| "escape" \| "api" }` | #### Inbound events | Event | Detail | | ------------- | ------------------- | | `tooltip:set` | `{ open: boolean }` | Read the [installed source](/r/tooltip.json) for the complete prop types. ## When to use Tooltip Use Tooltip for a short explanation that supports an already understandable control. Keep the trigger and content under one root. Essential instructions belong in visible page text. ## Keyboard and behavior The data-slot controller handles timing and visibility. Check keyboard focus as well as pointer hover. The control still needs an accessible name; a tooltip is not a substitute for an icon button label. ## Theme and layout The popup uses the shared popover surface and compact text. Test placement near viewport edges and keep the message short. Interactive content is better placed in a popover. --- # Video for Astro Source: https://ui.gnosticai.com/components/video ```astro --- import { Video } from "@/components/ui/video" import video from "@/assets/wizard/wizard-overlooking-town.mp4?url" import poster from "@/assets/wizard/wizard-overlooking-town.png?url" ---