gradient
fulldev-ui/gradientFreeComponent
fulldev/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by fulldev/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.full.dev/r/gradient.jsonSource
1---2import type { HTMLAttributes } from "astro/types"3import { cva, type VariantProps } from "class-variance-authority"45import { cn } from "@/lib/utils"67const gradientVariants = cva(8 "bg-primary pointer-events-none absolute inset-0 opacity-50 [--gradient-stops:black,transparent]",9 {10 variants: {11 variant: {12 radial:13 "[mask-image:radial-gradient(ellipse_at_var(--gradient-position),var(--gradient-stops))] [-webkit-mask-image:radial-gradient(ellipse_at_var(--gradient-position),var(--gradient-stops))]",14 linear:15 "[mask-image:linear-gradient(var(--gradient-direction),var(--gradient-stops))] [-webkit-mask-image:linear-gradient(var(--gradient-direction),var(--gradient-stops))]",16 },17 direction: {18 left: "[--gradient-direction:to_left] [--gradient-position:0%_50%]",19 right: "[--gradient-direction:to_right] [--gradient-position:100%_50%]",20 top: "[--gradient-direction:to_top] [--gradient-position:50%_0%]",21 bottom:22 "[--gradient-direction:to_bottom] [--gradient-position:50%_100%]",23 center:24 "[--gradient-direction:to_bottom] [--gradient-position:50%_50%]",25 },26 },27 defaultVariants: {28 variant: "radial",29 direction: "bottom",30 },31 }32)3334type Props = HTMLAttributes<"div"> & VariantProps<typeof gradientVariants>3536const { class: className, variant, direction, ...props } = Astro.props37---3839<div40 data-slot="gradient"41 aria-hidden="true"42 class={cn(gradientVariants({ variant, direction }), className)}43 {...props}44>45</div>
Files it writes
More from fulldev/ui
All 144 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | fulldev/ui | Components | Free | 1 dep · 5 files | |
| alertalert | fulldev/ui | Components | Free | no deps · 5 files | |
| alert-dialogalert-dialog | fulldev/ui | Components | Free | 1 dep · 13 files | |
| avataravatar | fulldev/ui | Components | Free | no deps · 7 files | |
| badgebadge | fulldev/ui | Components | Free | no deps · 3 files | |
| bannerbanner | fulldev/ui | Components | Free | no deps · 3 files | |
| breadcrumbbreadcrumb | fulldev/ui | Components | Free | no deps · 8 files | |
| buttonbutton | fulldev/ui | Components | Free | no deps · 3 files |
