Terms

Free · MIT

The app's terms; defaults are "environment" and "account".

Markdown

Preview

Install

With the Candor CLI

First time? Get started sets up the registry and theme. Or with shadcn directly: npx shadcn@latest add @candor/terms

Usage

TSX · The example above
"use client"

import { TermsProvider, useTerms } from "@/components/terms"

function Heading() {
  const terms = useTerms()
  return <p className="text-sm">Choose a {terms.environment} to work in.</p>
}

export default function Example() {
  return (
    <div className="flex flex-col gap-2">
      <Heading />
      <TermsProvider terms={{ environment: "project" }}>
        <Heading />
      </TermsProvider>
    </div>
  )
}

<TermsProvider>

PropTypeDefaultDescription
termsrequiredPartial<Terms>—The words to use; any left out fall back to the ones above.
childrenrequiredReact.ReactNode—What goes inside.

Functions

useTerms()

The app's terms; defaults are "environment" and "account".

Types

Terms
The app's words for its own concepts, so components read like the product: one app says "org", another "project" or "workspace".
{ /** One place agents act in. */ environment: string environments: string /** The paying customer that owns the environments. */ account: string /** The product's own name, for labels like "In the app" and "What the app will read". */ product: string }