Skip to content

COMPONENT / access-card

Access/ID Card_

Ink ID badge with a hazard band, access level chip, photo slot, name, ID line and barcode. Requires @cybr/tokens and @cybr/effects.

Install

  1. 1. Map the @cybr namespace, once per project. Add this inside your components.json, or into its existing "registries" object. No components.json yet? Run npx shadcn@latest init first to create one.

    "registries": { "@cybr": "https://cybr-ui.com/r/{name}.json" }
  2. 2. Add components:

    $ npx shadcn@latest add @cybr/access-card

If shadcn reports Unknown registry "@cybr", step 1 is missing from that project's components.json.

Preview

ACCESS LVL03

[Operator name]

ID 0x4F2A-91 · EXP 2099

Props

Component props
PropTypeDefaultDescription
nameReactNode—Card holder name, set in the display face.
levelReactNode—Access level, shown in the dark chip.
levelLabelReactNode"ACCESS LVL"Text before the level chip.
idLineReactNode—Small mono line under the name, such as an ID and expiry.
photoReactNode—Image for the photo slot. It fills the slot with object-fit: cover. Without it, the slot shows a crosshair.
...propsOmit<ComponentProps<"div">, "children">—Every other native <div> attribute is forwarded; className is merged last with cn(). Set the width here.

Usage

Needs both stylesheets from @cybr/tokens and @cybr/effects. After the install, import them in app/globals.css:

@import "tailwindcss";
@import "../styles/cybr-tokens.css";
@import "../styles/cybr-effects.css";
import Image from "next/image";

import { AccessCard } from "@/components/ui/access-card";

export function Badge() {
  return (
    <AccessCard
      className="w-64"
      level="03"
      name="K. Morrow"
      idLine="ID 0x4F2A-91 · EXP 2099"
      photo={<Image src="/morrow.jpg" alt="K. Morrow" width={256} height={96} />}
    />
  );
}

Anatomy

Accessibility