Careers: open role list
A list of roles with team, location, employment type and optional detail links.
pnpm dlx shadcn@latest add @haze/careers-role-list---
import { ArrowUpRight, MapPin } from "@lucide/astro";
import { cn } from "../../../lib/haze/utils";
interface Props {
id?: string;
eyebrow?: string;
title?: string;
description?: string;
headingLevel?: 1 | 2 | 3;
roles?: { title: string; team: string; location: string; type: string; href?: string }[];
class?: string;
}
const {
id = "careers-role-list",
eyebrow = "Careers",
title = "Do thoughtful work with us",
description = "These example roles show how to share openings with the people who might be a great fit.",
headingLevel = 2,
roles = [
{ title: "Senior product designer", team: "Design", location: "Remote", type: "Full time" },
{ title: "Frontend engineer", team: "Engineering", location: "Remote", type: "Full time" },
{ title: "Customer experience lead", team: "Customer experience", location: "London or remote", type: "Full time" },
],
class: className,
} = Astro.props;
const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel];
const RoleHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel];
---
<section aria-labelledby={`${id}-title`} class={cn("bg-background px-6 py-20 sm:py-24", className)}>
<div class="mx-auto max-w-6xl">
<div class="max-w-2xl">
<p class="text-[0.6875rem]/4 font-medium tracking-wider text-muted-foreground uppercase">{eyebrow}</p>
<Heading id={`${id}-title`} class="mt-3 text-3xl/9 font-semibold tracking-tight text-balance text-foreground sm:text-4xl/11">{title}</Heading>
<p class="mt-4 text-base/7 text-pretty text-muted-foreground">{description}</p>
</div>
<ul class="mt-12 divide-y divide-border border-y border-border">
{roles.map((role) => (
<li class="flex flex-col gap-3 py-6 sm:flex-row sm:items-center sm:justify-between sm:gap-8">
<div class="min-w-0">
<p class="text-[0.6875rem]/4 font-medium tracking-wider text-muted-foreground uppercase">{role.team}</p>
<RoleHeading class="mt-2 text-base/6 font-semibold tracking-tight text-foreground">
{role.href ? <a href={role.href} class="rounded-sm underline-offset-4 hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring">{role.title}<ArrowUpRight aria-hidden="true" class="ml-1 inline size-4" /></a> : role.title}
</RoleHeading>
</div>
<div class="flex flex-wrap items-center gap-x-4 gap-y-2 text-[0.8125rem]/5 text-muted-foreground">
<span class="inline-flex items-center gap-1.5"><MapPin aria-hidden="true" class="size-4" />{role.location}</span>
<span class="rounded-sm bg-foreground/5 px-2 py-1 inset-ring inset-ring-frame">{role.type}</span>
</div>
</li>
))}
</ul>
</div>
</section>When to use
- Presenting a small set of current job openings
- Applicants need to scan location and role type before opening a listing
When not to use
- Introducing existing teammates rather than open roles; use team-profile-grid
Installation
Add the Haze registry to components.json once, then install Careers: open role list with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.
pnpm dlx shadcn@latest add @haze/careers-role-listnpx shadcn@latest add @haze/careers-role-listyarn dlx shadcn@latest add @haze/careers-role-listbunx --bun shadcn@latest add @haze/careers-role-listFirst time? Registry and theme setup
1. Add to components.json:
{
"registries": {
"@haze": "http://localhost:4329/r/{name}.json"
}
}2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | "careers-role-list" | Unique ID prefix for the section heading. |
| eyebrow | string | "Careers" | Label above the title. |
| title | string | demo heading | Careers section heading. |
| description | string | demo copy | Introduction; the default identifies the sample roles as examples. |
| headingLevel | 1 | 2 | 3 | 2 | Heading level; role titles use the next level. |
| roles | { title: string; team: string; location: string; type: string; href?: string }[] | 3 example roles | Roles to display; provide href for a working listing link. |
| class | string | – | Additional section classes. |
Keyboard interactions
- Tab
- Move between role links when URLs are provided.
Accessibility
- Role titles are headings in a list; location and employment type are visible text.
- The arrow and location icons are decorative and hidden from assistive technology.
Notes for AI
Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.
Install and use
Install the Haze UI block "Careers: open role list" with `npx shadcn@latest add @haze/careers-role-list`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CareersRoleList from "@/components/haze/blocks/careers-role-list.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/blocks/careers-role-list.md
Customize with real content
Adapt the Haze careers-role-list block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, roles, class. Keep the layout, the heading level rules and these accessibility details: Role titles are headings in a list; location and employment type are visible text. The arrow and location icons are decorative and hidden from assistive technology. Do not add raw color classes; use the Haze tokens.
Choose the right block
Before using careers-role-list, check it fits: use it when presenting a small set of current job openings; applicants need to scan location and role type before opening a listing. Avoid it when introducing existing teammates rather than open roles; use team-profile-grid. Alternatives: @haze/team-profile-grid.
Dependencies
- npm: @lucide/astro
- @haze/utils
- @haze/theme (one-time setup)
Source · Original Haze UI work.