ConsentCheckbox
A checkbox whose label is a consent sentence with inline links to the terms and policies.
checkbox-variantsOpen in Figma ↗A labelled checkbox row combining a checkbox atom with inline text and optional link buttons, for use in consent and agreement contexts.
Use for: Consent flows, terms acceptance, and any form field where the label contains one or more linked legal documents — such as "Agree to T&C's and Privacy Policy before proceeding."
Not for: Standard list selections or filter choices — use the bare checkbox atom or chips instead. Not for multi-option form groups without inline links — use a list of checkbox atoms with adjacent labels.
Choosing: Set inverse=false on light or neutral backgrounds. Set inverse=true on midnight or brand red surfaces — all text and link colours adapt automatically. Set selected=true when the user has agreed. Set disabled=true to prevent interaction — both the checkbox and all inline links reduce to their disabled colour tokens.
Rules: Do not detach to change the label copy — edit text via the component's text properties. Inline link buttons are link-type buttons and inherit disabled state from the parent; do not make them independently interactive when disabled=true. Always include the full label — do not use this component with a blank label.
import SwiftUI import EandTokens // checkbox-variants: a 20pt checkbox, gap 8, then ONE wrapping body/md run — // prefix · link · "and" · link · suffix. Links are body/md link ink, no underline. // Tapping a link opens it; tapping the box toggles it. struct ConsentCheckbox: View { @Binding var on: Bool var body: some View { HStack(alignment: .top, spacing: EandSpacing.sm) { CheckboxMark(on: on).onTapGesture { on.toggle() } // see Checkbox Text("Agree to the [Terms & Conditions](eand://terms) and [Privacy Policy](eand://privacy) before proceeding") .font(.system(size: EandTypography.bodyMd.size)) .foregroundColor(EandColor.textDefaultDefault) .tint(EandColor.buttonLinkTextBrandDefault) } .accessibilityElement(children: .combine) .accessibilityAddTraits(on ? .isSelected : []) } }
When to use
- Use when a person must accept terms before going on, typically in the
termsslot of the CTA Bar or an ActionBlock. - Don't use for ordinary options or preferences; that is Checkbox, or Switcher for a setting that applies at once.
Anatomy
The label is one wrapping sentence: prefix · first link · conjunction · second link ·
suffix, for example "Agree to the Terms and Privacy Policy before proceeding". Two links are
joined by conjunction (default "and").
- A link with
hrefrenders as an anchor; without it, as a button that callsonClick. - Selecting a link follows it without toggling the box. Selecting the rest of the sentence toggles the box.
disableddisables the box and its links together.
The box is always the md (20px) checkbox. Besides its own props, ConsentCheckbox accepts the
props of Checkbox — checked, defaultChecked, onChange, disabled and
inverse — and passes them through.
import { useState } from 'react';
import { ConsentCheckbox } from '@eand/react-design-system';
function Terms() {
const [agreed, setAgreed] = useState(false);
return (
<ConsentCheckbox
checked={agreed}
onChange={(e) => setAgreed(e.currentTarget.checked)}
prefix="Agree to the"
links={[
{ label: 'Terms', href: '/terms' },
{ label: 'Privacy Policy', href: '/privacy' },
]}
suffix="before proceeding"
/>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
conjunction? | ReactNode | and | Word between the links (Figma "and"). |
inverse? | boolean | — | Inverse color scheme for dark (midnight/brand) surfaces (Figma color-scheme=inverse). |
links? | ConsentLink[] | [] | Inline legal links (Figma link-1, link-2). Two are joined by conjunction. |
prefix? | ReactNode | — | Text before the first link (Figma title-string, "Agree to"). |
suffix? | ReactNode | — | Text after the links (Figma description-string, "before proceeding"). |
Design
Figma source: checkbox-variants — etisalat Consumer App DSL V1.2
- A md checkbox, then the sentence 8px away (
spacing/sm), inbody/md. - Copy:
text/default/default, ortext/default/disabledwhen disabled. Inverse:text/default/inverse-subtleandtext/default/inverse-disabled. - Links follow
button type=link size=md:body/md, 2px inline padding (spacing/2xs), no underline, inbutton/link/text/brand/*or, inverse,button/link/text/inverse/*. - The core
.checkbox-core-variants-corehas an RTL mirror; the flex row followsdir.