@affinda/react 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +412 -416
- package/dist/components/AfAccordionTrigger.d.ts +22 -0
- package/dist/components/AfAccordionTrigger.js +18 -0
- package/dist/components/AfAlert.d.ts +22 -0
- package/dist/components/AfAlert.js +67 -0
- package/dist/components/AfAvatar.d.ts +21 -0
- package/dist/components/AfAvatar.js +62 -0
- package/dist/components/AfBreadcrumb.d.ts +21 -0
- package/dist/components/AfBreadcrumb.js +32 -0
- package/dist/components/AfLink.d.ts +21 -0
- package/dist/components/AfLink.js +30 -0
- package/dist/components/AfMarketingNavbar.d.ts +53 -0
- package/dist/components/AfMarketingNavbar.js +23 -0
- package/dist/components/AfModal.d.ts +25 -0
- package/dist/components/AfModal.js +71 -0
- package/dist/components/AfNumberBadge.d.ts +20 -0
- package/dist/components/{NumberBadge.js → AfNumberBadge.js} +3 -3
- package/dist/components/AfPaperclipDecoration.d.ts +23 -0
- package/dist/components/{PaperclipDecoration.js → AfPaperclipDecoration.js} +9 -8
- package/dist/components/AfSelect.d.ts +34 -0
- package/dist/components/AfSelect.js +104 -0
- package/dist/components/AfSkeleton.d.ts +19 -0
- package/dist/components/AfSkeleton.js +50 -0
- package/dist/components/AfSpinner.d.ts +47 -0
- package/dist/components/AfSpinner.js +54 -0
- package/dist/components/{Tab.d.ts → AfTab.d.ts} +5 -5
- package/dist/components/{Tab.js → AfTab.js} +3 -3
- package/dist/components/AfTabBar.d.ts +20 -0
- package/dist/components/{TabBar.js → AfTabBar.js} +3 -3
- package/dist/components/AfToast.d.ts +22 -0
- package/dist/components/AfToast.js +77 -0
- package/dist/components/AfTooltip.d.ts +19 -0
- package/dist/components/AfTooltip.js +80 -0
- package/dist/generated/components.d.ts +58 -3
- package/dist/generated/components.js +117 -9
- package/dist/index.d.ts +31 -8
- package/dist/index.js +20 -9
- package/package.json +3 -3
- package/dist/components/NumberBadge.d.ts +0 -20
- package/dist/components/PaperclipDecoration.d.ts +0 -22
- package/dist/components/TabBar.d.ts +0 -20
package/README.md
CHANGED
|
@@ -26,18 +26,18 @@ defineCustomElements();
|
|
|
26
26
|
### 2. Use Components
|
|
27
27
|
|
|
28
28
|
```tsx
|
|
29
|
-
import {
|
|
29
|
+
import { AfButton, AfNavbar, AfNavItem } from '@affinda/react';
|
|
30
30
|
|
|
31
31
|
function App() {
|
|
32
32
|
return (
|
|
33
33
|
<div>
|
|
34
|
-
{/*
|
|
35
|
-
<
|
|
34
|
+
{/* AfNavbar displays the default Affinda logo automatically */}
|
|
35
|
+
<AfNavbar>
|
|
36
36
|
<div slot="start">
|
|
37
|
-
<
|
|
37
|
+
<AfNavItem href="/products">Products</AfNavItem>
|
|
38
38
|
</div>
|
|
39
|
-
<
|
|
40
|
-
</
|
|
39
|
+
<AfButton slot="button" variant="primary">Get Started</AfButton>
|
|
40
|
+
</AfNavbar>
|
|
41
41
|
</div>
|
|
42
42
|
);
|
|
43
43
|
}
|
|
@@ -70,144 +70,77 @@ Affinda components use the **NeuSans** font family. To get the authentic Affinda
|
|
|
70
70
|
|
|
71
71
|
## Usage
|
|
72
72
|
|
|
73
|
-
> ⚠️ **Theme Container Requirement:** Always wrap your components in a theme-providing container like `
|
|
73
|
+
> ⚠️ **Theme Container Requirement:** Always wrap your components in a theme-providing container like `AfSection` or `AfCard`. These containers establish theme context via CSS custom properties that child components (AfHeading, AfText, AfButton, etc.) consume for their colors.
|
|
74
74
|
>
|
|
75
75
|
> ```tsx
|
|
76
|
-
> <
|
|
77
|
-
> <
|
|
78
|
-
> <
|
|
79
|
-
> </
|
|
76
|
+
> <AfSection theme="white">
|
|
77
|
+
> <AfHeading level="1">Title</AfHeading>
|
|
78
|
+
> <AfText>Content with proper colors</AfText>
|
|
79
|
+
> </AfSection>
|
|
80
80
|
> ```
|
|
81
81
|
|
|
82
|
-
### Import Components
|
|
83
|
-
|
|
84
|
-
All components are available with or without the `Af` prefix:
|
|
85
|
-
|
|
86
|
-
```tsx
|
|
87
|
-
// With Af prefix
|
|
88
|
-
import { AfButton, AfHeading, AfTypographyLockup } from '@affinda/react';
|
|
89
|
-
|
|
90
|
-
// Without prefix (cleaner)
|
|
91
|
-
import { Button, Heading, TypographyLockup } from '@affinda/react';
|
|
92
|
-
```
|
|
93
|
-
|
|
94
82
|
### Available Components
|
|
95
83
|
|
|
96
84
|
Components are organized by complexity level. **Always compose from these levels** — don't write custom HTML/CSS for layouts that components already handle.
|
|
97
85
|
|
|
98
86
|
#### Atoms (Basic Building Blocks)
|
|
99
87
|
|
|
100
|
-
- **
|
|
101
|
-
- **
|
|
102
|
-
- **
|
|
103
|
-
- **
|
|
104
|
-
- **
|
|
105
|
-
- **
|
|
106
|
-
- **
|
|
107
|
-
- **
|
|
108
|
-
- **
|
|
109
|
-
- **
|
|
110
|
-
- **
|
|
111
|
-
- **
|
|
112
|
-
- **
|
|
88
|
+
- **AfButton** - Primary buttons with variants and icons
|
|
89
|
+
- **AfIconButton** - Icon-only buttons
|
|
90
|
+
- **AfHeading** - Typography headings (H1-H6) with theme support
|
|
91
|
+
- **AfText** - Body text components with theme support
|
|
92
|
+
- **AfTag** - Categorization labels with sand and light variants
|
|
93
|
+
- **AfSection** - Page sections with consistent spacing and themes ⭐ *provides theme context*
|
|
94
|
+
- **AfCard** - Content cards with optional backgrounds and photo variants ⭐ *provides theme context*
|
|
95
|
+
- **AfContainer** - Layout containers with max-width
|
|
96
|
+
- **AfIconBox** - Themed container for displaying an icon with rounded background
|
|
97
|
+
- **AfLogo** - Affinda logo component
|
|
98
|
+
- **AfLogoWell** - Rounded container for client logos
|
|
99
|
+
- **AfAspectRatio** - Maintain aspect ratios for media
|
|
100
|
+
- **AfColorSwatch** - Display color swatches
|
|
113
101
|
|
|
114
102
|
#### Molecules (Composed from Atoms)
|
|
115
103
|
|
|
116
|
-
- **
|
|
117
|
-
- **
|
|
118
|
-
- **
|
|
119
|
-
- **
|
|
120
|
-
- **
|
|
121
|
-
- **
|
|
122
|
-
- **
|
|
123
|
-
- **
|
|
124
|
-
- **
|
|
125
|
-
- **
|
|
126
|
-
- **
|
|
127
|
-
- **
|
|
128
|
-
- **
|
|
129
|
-
- **
|
|
104
|
+
- **AfButtonGroup** - Group multiple buttons together
|
|
105
|
+
- **AfTypographyLockup** - Composite heading + text + button layouts
|
|
106
|
+
- **AfIconText** - AfIconBox + AfTypographyLockup for feature items with icons
|
|
107
|
+
- **AfFeatureCard** - AfCard + image + AfTypographyLockup for feature showcase
|
|
108
|
+
- **AfIllustratedCard** - AfCard + illustration slot
|
|
109
|
+
- **AfNavItem** - Navigation items
|
|
110
|
+
- **AfNavCard** - Navigation card with icon and description
|
|
111
|
+
- **AfTestimonial** - Customer testimonials with background images, stats, and quotes
|
|
112
|
+
- **AfTestimonialStat** - Individual statistics within testimonials
|
|
113
|
+
- **AfFooterColumn** - Navigation column for footer
|
|
114
|
+
- **AfFooterLink** - Styled link for footer navigation
|
|
115
|
+
- **AfSocialLink** - Circular social media icon link
|
|
116
|
+
- **AfContactItem** - Label/value pair for contact info
|
|
117
|
+
- **AfPaperclipDecoration** - Decorative paperclip vector for hero sections
|
|
130
118
|
|
|
131
119
|
#### Organisms (Page Sections)
|
|
132
120
|
|
|
133
|
-
- **
|
|
134
|
-
- **
|
|
135
|
-
- **
|
|
136
|
-
- **
|
|
137
|
-
- **
|
|
138
|
-
- **
|
|
139
|
-
- **
|
|
140
|
-
- **
|
|
141
|
-
- **
|
|
142
|
-
- **Footer** / AfFooter - Slot-based footer layout component
|
|
121
|
+
- **AfNavbar** - Navigation bar with mobile hamburger menu
|
|
122
|
+
- **AfFeatureGrid** - Responsive CSS grid container for feature cards/items
|
|
123
|
+
- **AfFeatureAccordion** - Expandable accordion with auto-cycling timer
|
|
124
|
+
- **AfGridCallout** - Image + heading + AfIconText grid for feature sections
|
|
125
|
+
- **AfSplitSection** - Two-column layouts with image and content
|
|
126
|
+
- **AfClientCarousel** - Infinite scrolling carousel for client logos
|
|
127
|
+
- **AfTestimonialCarousel** - Carousel for sliding between testimonials
|
|
128
|
+
- **AfInPageBanner** - Call-to-action banner card with illustration ⭐ *provides theme context*
|
|
129
|
+
- **AfFooter** - Slot-based footer layout component
|
|
143
130
|
|
|
144
131
|
## Quick Start Components
|
|
145
132
|
|
|
146
|
-
###
|
|
147
|
-
|
|
148
|
-
The hero section component makes it easy to create marketing page heroes with consistent styling. It uses **TypographyLockup** internally to handle proper spacing and layout of heading, description, and buttons.
|
|
149
|
-
|
|
150
|
-
```tsx
|
|
151
|
-
import { HeroSection, Heading, Text, Button, ButtonGroup, PaperclipDecoration } from '@affinda/react';
|
|
152
|
-
|
|
153
|
-
<HeroSection
|
|
154
|
-
theme="inkwell"
|
|
155
|
-
withDecoration={true}
|
|
156
|
-
minHeight="60vh"
|
|
157
|
-
headingSize={1}
|
|
158
|
-
textAlignment="center"
|
|
159
|
-
buttonAlignment="horizontal"
|
|
160
|
-
>
|
|
161
|
-
{/* Position the paperclip decoration - adjust bottom/right values as needed */}
|
|
162
|
-
<PaperclipDecoration
|
|
163
|
-
slot="decoration"
|
|
164
|
-
style={{ position: 'absolute', bottom: -80, right: -800 }}
|
|
165
|
-
/>
|
|
166
|
-
<Heading slot="heading" level="1">
|
|
167
|
-
Harness AI to transform business processes
|
|
168
|
-
</Heading>
|
|
169
|
-
<Text slot="description" variant="large">
|
|
170
|
-
Around the world, leading enterprises use Affinda's AI agents...
|
|
171
|
-
</Text>
|
|
172
|
-
<ButtonGroup slot="buttons" direction="horizontal" gap="12px">
|
|
173
|
-
<Button variant="primary">Discover the platform</Button>
|
|
174
|
-
<Button variant="secondary">Explore solutions</Button>
|
|
175
|
-
</ButtonGroup>
|
|
176
|
-
</HeroSection>
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
**Props:**
|
|
180
|
-
- `theme`: `"white"` | `"inkwell"` | `"mist-green"` | `"soft-clay"` (default: `"inkwell"`)
|
|
181
|
-
- `withDecoration`: boolean - Shows decoration slot
|
|
182
|
-
- `minHeight`: string - CSS min-height value
|
|
183
|
-
- `headingSize`: `1` | `2` | `3` | `4` | `5` - Controls heading size and spacing (default: `1`)
|
|
184
|
-
- `textAlignment`: `"left"` | `"center"` - Text alignment (default: `"center"`)
|
|
185
|
-
- `buttonAlignment`: `"horizontal"` | `"vertical"` - Button layout direction (default: `"horizontal"`)
|
|
186
|
-
- `maxWidth`: number - Maximum width for the copy section in pixels
|
|
187
|
-
|
|
188
|
-
**Slots:**
|
|
189
|
-
- `heading` - The main heading (typically a `<Heading>` component)
|
|
190
|
-
- `description` - Description text (typically a `<Text>` component)
|
|
191
|
-
- `buttons` - CTA buttons (typically a `<ButtonGroup>` or individual buttons)
|
|
192
|
-
- `decoration` - Optional decorative element (e.g., `<PaperclipDecoration>`)
|
|
193
|
-
|
|
194
|
-
**Features:**
|
|
195
|
-
- Uses TypographyLockup internally for consistent heading/description/button layout
|
|
196
|
-
- Child components (Heading, Text, Button) automatically inherit theme colors - no manual theme props needed
|
|
197
|
-
- Built-in padding that accounts for floating navbar
|
|
198
|
-
- Responsive on mobile
|
|
199
|
-
|
|
200
|
-
### Section
|
|
133
|
+
### AfSection
|
|
201
134
|
|
|
202
135
|
The section component provides consistent spacing and backgrounds for page sections.
|
|
203
136
|
|
|
204
137
|
```tsx
|
|
205
|
-
import {
|
|
138
|
+
import { AfSection, AfHeading, AfText } from '@affinda/react';
|
|
206
139
|
|
|
207
|
-
<
|
|
208
|
-
<
|
|
209
|
-
<
|
|
210
|
-
</
|
|
140
|
+
<AfSection padding="default" theme="mist-green" container={true}>
|
|
141
|
+
<AfHeading level="2" align="center">Work smarter, grow faster</AfHeading>
|
|
142
|
+
<AfText variant="large" align="center">Feature content here...</AfText>
|
|
143
|
+
</AfSection>
|
|
211
144
|
```
|
|
212
145
|
|
|
213
146
|
**Props:**
|
|
@@ -215,33 +148,33 @@ import { Section, Heading, Text } from '@affinda/react';
|
|
|
215
148
|
- `theme`: `"white"` | `"inkwell"` | `"mist-green"` | `"soft-clay"` (default: `"white"`)
|
|
216
149
|
- `container`: boolean - Auto-wraps content in Container
|
|
217
150
|
|
|
218
|
-
> **Theme inheritance:** Child components (
|
|
151
|
+
> **Theme inheritance:** Child components (AfHeading, AfText, AfButton) automatically inherit the section's theme colors. No manual theme props needed on children!
|
|
219
152
|
|
|
220
|
-
###
|
|
153
|
+
### AfCard
|
|
221
154
|
|
|
222
155
|
Cards support themed backgrounds and photo backgrounds. Use the `theme` prop for consistent styling with theme inheritance.
|
|
223
156
|
|
|
224
157
|
```tsx
|
|
225
|
-
import {
|
|
158
|
+
import { AfCard, AfHeading, AfText } from '@affinda/react';
|
|
226
159
|
|
|
227
160
|
// Themed card (recommended) - children inherit theme colors automatically
|
|
228
|
-
<
|
|
229
|
-
<
|
|
230
|
-
<
|
|
161
|
+
<AfCard theme="mist-green">
|
|
162
|
+
<AfHeading level="3">Automate any document with 99%+ accuracy</AfHeading>
|
|
163
|
+
<AfText variant="large">Extract any information...</AfText>
|
|
231
164
|
<img src="screenshot.webp" alt="Feature" />
|
|
232
|
-
</
|
|
165
|
+
</AfCard>
|
|
233
166
|
|
|
234
167
|
// Dark themed card
|
|
235
|
-
<
|
|
236
|
-
<
|
|
237
|
-
<
|
|
238
|
-
</
|
|
168
|
+
<AfCard theme="inkwell">
|
|
169
|
+
<AfHeading level="3">Build models in minutes</AfHeading>
|
|
170
|
+
<AfText variant="large">Affinda is the only AI platform...</AfText>
|
|
171
|
+
</AfCard>
|
|
239
172
|
|
|
240
173
|
// Photo background card (for custom backgrounds)
|
|
241
|
-
<
|
|
242
|
-
<
|
|
243
|
-
<
|
|
244
|
-
</
|
|
174
|
+
<AfCard backgroundImage="photo.jpg" darkOverlay={true}>
|
|
175
|
+
<AfHeading level="3">Build models in minutes</AfHeading>
|
|
176
|
+
<AfText variant="large">Affinda is the only AI platform...</AfText>
|
|
177
|
+
</AfCard>
|
|
245
178
|
```
|
|
246
179
|
|
|
247
180
|
**Props:**
|
|
@@ -250,26 +183,28 @@ import { Card, Heading, Text } from '@affinda/react';
|
|
|
250
183
|
- `backgroundImage`: URL to background image
|
|
251
184
|
- `darkOverlay`: boolean - Applies gradient overlay for text readability on photos
|
|
252
185
|
|
|
253
|
-
###
|
|
186
|
+
### AfPaperclipDecoration
|
|
254
187
|
|
|
255
188
|
Decorative SVG paperclip graphic for hero sections.
|
|
256
189
|
|
|
257
|
-
|
|
190
|
+
Use with `AfSection` and position absolutely within the section:
|
|
258
191
|
|
|
259
192
|
```tsx
|
|
260
|
-
import {
|
|
193
|
+
import { AfSection, AfContainer, AfTypographyLockup, AfPaperclipDecoration } from '@affinda/react';
|
|
261
194
|
|
|
262
|
-
<
|
|
263
|
-
<
|
|
264
|
-
slot="decoration"
|
|
195
|
+
<AfSection theme="inkwell" padding="loose" style={{ position: 'relative', overflow: 'hidden' }}>
|
|
196
|
+
<AfPaperclipDecoration
|
|
265
197
|
style={{
|
|
266
198
|
position: 'absolute',
|
|
267
199
|
bottom: -80, // Adjust to move vertically
|
|
268
|
-
right: -800
|
|
200
|
+
right: -800, // Adjust to move horizontally
|
|
201
|
+
zIndex: 0
|
|
269
202
|
}}
|
|
270
203
|
/>
|
|
271
|
-
{
|
|
272
|
-
|
|
204
|
+
<AfContainer style={{ position: 'relative', zIndex: 1 }}>
|
|
205
|
+
{/* Hero content */}
|
|
206
|
+
</AfContainer>
|
|
207
|
+
</AfSection>
|
|
273
208
|
```
|
|
274
209
|
|
|
275
210
|
**Positioning Tips:**
|
|
@@ -277,7 +212,7 @@ import { HeroSection, PaperclipDecoration } from '@affinda/react';
|
|
|
277
212
|
- **bottom**: Controls vertical position (negative = move down/off-screen)
|
|
278
213
|
- **right**: Controls horizontal position (negative = move right/off-screen)
|
|
279
214
|
- Start with `bottom: -80, right: -800` and adjust to taste
|
|
280
|
-
-
|
|
215
|
+
- Set `overflow: hidden` on the section to clip the decoration
|
|
281
216
|
|
|
282
217
|
## Component Guide
|
|
283
218
|
|
|
@@ -285,44 +220,44 @@ import { HeroSection, PaperclipDecoration } from '@affinda/react';
|
|
|
285
220
|
|
|
286
221
|
#### Layout & Structure
|
|
287
222
|
|
|
288
|
-
**
|
|
223
|
+
**AfContainer**
|
|
289
224
|
- Use for all page sections to maintain consistent max-width and horizontal padding
|
|
290
225
|
- Creates responsive layouts that don't span the full viewport on large screens
|
|
291
|
-
- Best practice: Wrap each major section of your page in
|
|
226
|
+
- Best practice: Wrap each major section of your page in an AfContainer
|
|
292
227
|
|
|
293
228
|
```tsx
|
|
294
|
-
<
|
|
295
|
-
<
|
|
296
|
-
<
|
|
297
|
-
</
|
|
229
|
+
<AfContainer>
|
|
230
|
+
<AfHeading level="2">Section Title</AfHeading>
|
|
231
|
+
<AfText>Section content goes here...</AfText>
|
|
232
|
+
</AfContainer>
|
|
298
233
|
```
|
|
299
234
|
|
|
300
|
-
**
|
|
235
|
+
**AfAspectRatio**
|
|
301
236
|
- Maintain consistent dimensions for images, videos, or media
|
|
302
237
|
- Prevents layout shift during content loading
|
|
303
238
|
- Common ratios: `16/9` (video), `1/1` (square), `4/3` (legacy video)
|
|
304
239
|
|
|
305
240
|
```tsx
|
|
306
|
-
<
|
|
241
|
+
<AfAspectRatio ratio="16/9">
|
|
307
242
|
<img src="video-thumbnail.jpg" alt="Preview" />
|
|
308
|
-
</
|
|
243
|
+
</AfAspectRatio>
|
|
309
244
|
```
|
|
310
245
|
|
|
311
|
-
**
|
|
246
|
+
**AfCard**
|
|
312
247
|
- Group related content with visual separation
|
|
313
248
|
- Use for feature highlights, product listings, or content previews
|
|
314
249
|
- Supports borders and elevation for depth
|
|
315
250
|
|
|
316
251
|
```tsx
|
|
317
|
-
<
|
|
318
|
-
<
|
|
319
|
-
<
|
|
320
|
-
</
|
|
252
|
+
<AfCard>
|
|
253
|
+
<AfHeading level="3">Feature Title</AfHeading>
|
|
254
|
+
<AfText>Feature description...</AfText>
|
|
255
|
+
</AfCard>
|
|
321
256
|
```
|
|
322
257
|
|
|
323
258
|
#### Typography
|
|
324
259
|
|
|
325
|
-
**
|
|
260
|
+
**AfHeading**
|
|
326
261
|
- Use semantic heading levels (1-6) for SEO and accessibility
|
|
327
262
|
- Level 1: Page title (use once per page)
|
|
328
263
|
- Level 2: Major sections
|
|
@@ -330,104 +265,104 @@ import { HeroSection, PaperclipDecoration } from '@affinda/react';
|
|
|
330
265
|
- Never skip heading levels
|
|
331
266
|
|
|
332
267
|
```tsx
|
|
333
|
-
<
|
|
334
|
-
<
|
|
335
|
-
<
|
|
268
|
+
<AfHeading level="1">Page Title</AfHeading>
|
|
269
|
+
<AfHeading level="2">Section Title</AfHeading>
|
|
270
|
+
<AfHeading level="3">Subsection</AfHeading>
|
|
336
271
|
```
|
|
337
272
|
|
|
338
|
-
**
|
|
273
|
+
**AfText**
|
|
339
274
|
- Use for all body text, descriptions, and paragraphs
|
|
340
275
|
- Variants: `default`, `small`, `large`
|
|
341
276
|
- Automatically uses NeuSans font
|
|
342
277
|
|
|
343
278
|
```tsx
|
|
344
|
-
<
|
|
345
|
-
<
|
|
346
|
-
<
|
|
279
|
+
<AfText variant="large">Introductory paragraph with emphasis</AfText>
|
|
280
|
+
<AfText>Standard body text</AfText>
|
|
281
|
+
<AfText variant="small">Fine print or captions</AfText>
|
|
347
282
|
```
|
|
348
283
|
|
|
349
|
-
**
|
|
284
|
+
**AfTypographyLockup**
|
|
350
285
|
- Composite component for hero sections and major content blocks
|
|
351
286
|
- Automatically handles heading + description + buttons layout
|
|
352
287
|
- Supports different breakpoints and alignments
|
|
353
288
|
- Use for: Hero sections, feature highlights, CTAs
|
|
354
289
|
|
|
355
290
|
```tsx
|
|
356
|
-
<
|
|
291
|
+
<AfTypographyLockup
|
|
357
292
|
headingSize={1}
|
|
358
293
|
textAlignment="center"
|
|
359
294
|
buttonAlignment="horizontal"
|
|
360
295
|
>
|
|
361
|
-
<
|
|
362
|
-
<
|
|
363
|
-
<
|
|
364
|
-
<
|
|
365
|
-
<
|
|
366
|
-
</
|
|
367
|
-
</
|
|
296
|
+
<AfHeading level="1">Automate Your Workflow</AfHeading>
|
|
297
|
+
<AfText slot="description">Extract data from documents in seconds</AfText>
|
|
298
|
+
<AfButtonGroup slot="buttons" direction="horizontal">
|
|
299
|
+
<AfButton variant="primary">Get Started</AfButton>
|
|
300
|
+
<AfButton variant="secondary">Learn More</AfButton>
|
|
301
|
+
</AfButtonGroup>
|
|
302
|
+
</AfTypographyLockup>
|
|
368
303
|
```
|
|
369
304
|
|
|
370
305
|
#### Buttons & Actions
|
|
371
306
|
|
|
372
|
-
**
|
|
307
|
+
**AfButton**
|
|
373
308
|
- Primary actions: Use `variant="primary"` (sparingly, 1-2 per screen)
|
|
374
309
|
- Secondary actions: Use `variant="secondary"`
|
|
375
310
|
- Sizes: `small`, `default`
|
|
376
311
|
- Can include icons in left or right slots
|
|
377
|
-
- Buttons automatically inherit theme colors from parent
|
|
312
|
+
- Buttons automatically inherit theme colors from parent AfSection/AfCard
|
|
378
313
|
|
|
379
314
|
```tsx
|
|
380
|
-
<
|
|
381
|
-
<
|
|
315
|
+
<AfButton variant="primary">Sign Up Now</AfButton>
|
|
316
|
+
<AfButton variant="secondary">Learn More</AfButton>
|
|
382
317
|
```
|
|
383
318
|
|
|
384
|
-
**
|
|
319
|
+
**AfButtonGroup**
|
|
385
320
|
- Group related buttons with consistent spacing
|
|
386
321
|
- Maintains visual hierarchy and alignment
|
|
387
322
|
|
|
388
323
|
```tsx
|
|
389
|
-
<
|
|
390
|
-
<
|
|
391
|
-
<
|
|
392
|
-
</
|
|
324
|
+
<AfButtonGroup>
|
|
325
|
+
<AfButton variant="primary">Save</AfButton>
|
|
326
|
+
<AfButton variant="secondary">Cancel</AfButton>
|
|
327
|
+
</AfButtonGroup>
|
|
393
328
|
```
|
|
394
329
|
|
|
395
|
-
**
|
|
330
|
+
**AfIconButton**
|
|
396
331
|
- Use for toolbar actions, navigation controls, or when space is limited
|
|
397
332
|
- Always include aria-label for accessibility
|
|
398
333
|
- Common uses: Close buttons, navigation arrows, menu toggles
|
|
399
334
|
|
|
400
335
|
```tsx
|
|
401
|
-
import {
|
|
336
|
+
import { AfIconButton, Close, Menu } from '@affinda/react';
|
|
402
337
|
|
|
403
|
-
<
|
|
338
|
+
<AfIconButton variant="secondary" aria-label="Close dialog">
|
|
404
339
|
<Close size={24} />
|
|
405
|
-
</
|
|
340
|
+
</AfIconButton>
|
|
406
341
|
|
|
407
|
-
<
|
|
342
|
+
<AfIconButton variant="tertiary" size="small" aria-label="Toggle menu">
|
|
408
343
|
<Menu size={20} />
|
|
409
|
-
</
|
|
344
|
+
</AfIconButton>
|
|
410
345
|
```
|
|
411
346
|
|
|
412
347
|
#### Tags
|
|
413
348
|
|
|
414
|
-
**
|
|
349
|
+
**AfTag**
|
|
415
350
|
- Use for categorization, topics, filters, or metadata display
|
|
416
351
|
- Variants: `sand` (default - soft-clay/tan) or `light` (mist-green)
|
|
417
352
|
- Sizes: `x-small`, `small` (default), `large`
|
|
418
353
|
- Can be clickable links with `href` prop
|
|
419
354
|
|
|
420
355
|
```tsx
|
|
421
|
-
<
|
|
422
|
-
<
|
|
423
|
-
<
|
|
356
|
+
<AfTag>AI</AfTag>
|
|
357
|
+
<AfTag variant="light">OCR</AfTag>
|
|
358
|
+
<AfTag variant="sand" size="large" href="/topics/ml">Machine Learning</AfTag>
|
|
424
359
|
```
|
|
425
360
|
|
|
426
361
|
#### Navigation
|
|
427
362
|
|
|
428
|
-
**
|
|
363
|
+
**AfNavbar**
|
|
429
364
|
|
|
430
|
-
⚠️ **IMPORTANT**: The
|
|
365
|
+
⚠️ **IMPORTANT**: The AfNavbar component uses **slots** for positioning elements. Items placed as direct children will not be visible. You must wrap them in divs with the appropriate `slot` attribute.
|
|
431
366
|
|
|
432
367
|
Site-wide navigation header with responsive design and mobile menu support.
|
|
433
368
|
|
|
@@ -453,38 +388,38 @@ This prevents page content from being hidden behind the navbar. The spacer autom
|
|
|
453
388
|
- `button` - Call-to-action button (far right)
|
|
454
389
|
|
|
455
390
|
```tsx
|
|
456
|
-
<
|
|
391
|
+
<AfNavbar>
|
|
457
392
|
{/* Start slot - main navigation items */}
|
|
458
393
|
<div slot="start">
|
|
459
|
-
<
|
|
394
|
+
<AfNavItem hierarchy="primary" variant="01" href="/platform">
|
|
460
395
|
Platform
|
|
461
|
-
</
|
|
462
|
-
<
|
|
396
|
+
</AfNavItem>
|
|
397
|
+
<AfNavItem hierarchy="primary" variant="01" href="/solutions">
|
|
463
398
|
Solutions
|
|
464
|
-
</
|
|
465
|
-
<
|
|
399
|
+
</AfNavItem>
|
|
400
|
+
<AfNavItem hierarchy="primary" variant="01" href="/pricing">
|
|
466
401
|
Pricing
|
|
467
|
-
</
|
|
402
|
+
</AfNavItem>
|
|
468
403
|
</div>
|
|
469
404
|
|
|
470
405
|
{/* End slot - secondary navigation */}
|
|
471
406
|
<div slot="end">
|
|
472
|
-
<
|
|
407
|
+
<AfNavItem hierarchy="primary" variant="02" href="/contact">
|
|
473
408
|
Talk to us
|
|
474
|
-
</
|
|
475
|
-
<
|
|
409
|
+
</AfNavItem>
|
|
410
|
+
<AfNavItem hierarchy="primary" variant="02" href="/login">
|
|
476
411
|
Log in
|
|
477
|
-
</
|
|
412
|
+
</AfNavItem>
|
|
478
413
|
</div>
|
|
479
414
|
|
|
480
415
|
{/* Button slot - CTA */}
|
|
481
|
-
<
|
|
416
|
+
<AfButton slot="button" variant="primary" size="default">
|
|
482
417
|
Try for free
|
|
483
|
-
</
|
|
484
|
-
</
|
|
418
|
+
</AfButton>
|
|
419
|
+
</AfNavbar>
|
|
485
420
|
```
|
|
486
421
|
|
|
487
|
-
**
|
|
422
|
+
**AfNavItem**
|
|
488
423
|
- Individual navigation links
|
|
489
424
|
- Hierarchy: `primary` (main nav), `secondary` (utility nav)
|
|
490
425
|
- Variant: `"01"` (primary links), `"02"` (secondary/utility links)
|
|
@@ -492,18 +427,18 @@ This prevents page content from being hidden behind the navbar. The spacer autom
|
|
|
492
427
|
|
|
493
428
|
#### Feature Showcase
|
|
494
429
|
|
|
495
|
-
**
|
|
430
|
+
**AfFeatureAccordion**
|
|
496
431
|
- Expandable accordion for showcasing product features
|
|
497
432
|
- Auto-cycles through items with a visual progress timer
|
|
498
433
|
- Displays accompanying images that change with each item
|
|
499
434
|
- Timer resets when user clicks an item
|
|
500
|
-
- **Must be wrapped in
|
|
435
|
+
- **Must be wrapped in an AfSection** which provides theme context and padding
|
|
501
436
|
|
|
502
437
|
```tsx
|
|
503
|
-
import {
|
|
438
|
+
import { AfSection, AfFeatureAccordion } from '@affinda/react';
|
|
504
439
|
|
|
505
|
-
<
|
|
506
|
-
<
|
|
440
|
+
<AfSection theme="mist-green" padding="default">
|
|
441
|
+
<AfFeatureAccordion
|
|
507
442
|
heading="Give AI agents your paperwork"
|
|
508
443
|
items={JSON.stringify([
|
|
509
444
|
{
|
|
@@ -522,7 +457,7 @@ import { Section, FeatureAccordion } from '@affinda/react';
|
|
|
522
457
|
cycleInterval={6000}
|
|
523
458
|
autoCycle={true}
|
|
524
459
|
/>
|
|
525
|
-
</
|
|
460
|
+
</AfSection>
|
|
526
461
|
```
|
|
527
462
|
|
|
528
463
|
**Props:**
|
|
@@ -535,17 +470,17 @@ import { Section, FeatureAccordion } from '@affinda/react';
|
|
|
535
470
|
- `theme`: `"white"` | `"inkwell"` | `"mist-green"` | `"soft-clay"` - Sets background and typography colors
|
|
536
471
|
- `padding`: `"tight"` | `"default"` | `"loose"` - Vertical spacing (default: `"default"`)
|
|
537
472
|
|
|
538
|
-
**
|
|
473
|
+
**AfInPageBanner**
|
|
539
474
|
- Call-to-action banner card with illustration and decorative wave background
|
|
540
|
-
- Place inside a neutral (white)
|
|
475
|
+
- Place inside a neutral (white) AfSection to show off its themed background
|
|
541
476
|
- Use `getIllustrationUrlByScene()` from `@affinda/illustrations` for theme-matched illustrations
|
|
542
477
|
|
|
543
478
|
```tsx
|
|
544
|
-
import {
|
|
479
|
+
import { AfSection, AfInPageBanner } from '@affinda/react';
|
|
545
480
|
import { getIllustrationUrlByScene } from '@affinda/illustrations';
|
|
546
481
|
|
|
547
|
-
<
|
|
548
|
-
<
|
|
482
|
+
<AfSection padding="default" theme="white" container={true}>
|
|
483
|
+
<AfInPageBanner
|
|
549
484
|
theme="mist-green"
|
|
550
485
|
heading="See what our AI agents can do for you"
|
|
551
486
|
description="Upload your documents and watch our AI agents get to work."
|
|
@@ -555,7 +490,7 @@ import { getIllustrationUrlByScene } from '@affinda/illustrations';
|
|
|
555
490
|
secondaryButtonUrl="/contact"
|
|
556
491
|
illustrationUrl={getIllustrationUrlByScene('automate', 'mist-green')}
|
|
557
492
|
/>
|
|
558
|
-
</
|
|
493
|
+
</AfSection>
|
|
559
494
|
```
|
|
560
495
|
|
|
561
496
|
**Props:**
|
|
@@ -571,52 +506,52 @@ import { getIllustrationUrlByScene } from '@affinda/illustrations';
|
|
|
571
506
|
|
|
572
507
|
#### Social Proof & Testimonials
|
|
573
508
|
|
|
574
|
-
**
|
|
509
|
+
**AfTestimonial**
|
|
575
510
|
- Showcase customer success stories with rich media
|
|
576
511
|
- Include: background image, logo, quote, attribution, and statistics
|
|
577
|
-
- Use within
|
|
512
|
+
- Use within AfTestimonialCarousel for multiple testimonials
|
|
578
513
|
|
|
579
514
|
```tsx
|
|
580
|
-
<
|
|
515
|
+
<AfTestimonial
|
|
581
516
|
backgroundImage="https://example.com/background.jpg"
|
|
582
517
|
logoImage="https://example.com/company-logo.png"
|
|
583
518
|
quote="Affinda transformed our document processing workflow."
|
|
584
519
|
attribution="– Jane Doe, CEO, Company Name"
|
|
585
520
|
readMoreLink="https://example.com/case-study"
|
|
586
521
|
>
|
|
587
|
-
<
|
|
588
|
-
<
|
|
589
|
-
</
|
|
522
|
+
<AfTestimonialStat slot="stats" value="95%" description="reduction in processing time" />
|
|
523
|
+
<AfTestimonialStat slot="stats" value="10×" description="increase in throughput" />
|
|
524
|
+
</AfTestimonial>
|
|
590
525
|
```
|
|
591
526
|
|
|
592
|
-
**
|
|
593
|
-
- Wrap with
|
|
527
|
+
**AfTestimonialCarousel**
|
|
528
|
+
- Wrap with AfSection for theming and AfContainer for layout (like other components)
|
|
594
529
|
- Automatically handles navigation between multiple testimonials
|
|
595
530
|
- Includes progress indicator
|
|
596
531
|
|
|
597
532
|
```tsx
|
|
598
|
-
<
|
|
599
|
-
<
|
|
600
|
-
<
|
|
601
|
-
<
|
|
602
|
-
<
|
|
603
|
-
</
|
|
604
|
-
<
|
|
605
|
-
<
|
|
606
|
-
</
|
|
607
|
-
</
|
|
608
|
-
</
|
|
533
|
+
<AfSection padding="default" theme="white" container>
|
|
534
|
+
<AfTestimonialCarousel>
|
|
535
|
+
<AfTestimonial {...testimonial1Props}>
|
|
536
|
+
<AfTestimonialStat slot="stats" value="95%" description="processing time reduction" />
|
|
537
|
+
<AfTestimonialStat slot="stats" value="10×" description="throughput increase" />
|
|
538
|
+
</AfTestimonial>
|
|
539
|
+
<AfTestimonial {...testimonial2Props}>
|
|
540
|
+
<AfTestimonialStat slot="stats" value="99%" description="accuracy rate" />
|
|
541
|
+
</AfTestimonial>
|
|
542
|
+
</AfTestimonialCarousel>
|
|
543
|
+
</AfSection>
|
|
609
544
|
```
|
|
610
545
|
|
|
611
|
-
**
|
|
546
|
+
**AfTestimonialStat**
|
|
612
547
|
- Display key metrics within testimonials
|
|
613
548
|
- Use `slot="stats"` on each stat to position correctly
|
|
614
549
|
- Use 2-4 stats per testimonial for best impact
|
|
615
550
|
- Optional accent border for qualitative statements
|
|
616
551
|
|
|
617
552
|
```tsx
|
|
618
|
-
<
|
|
619
|
-
<
|
|
553
|
+
<AfTestimonialStat slot="stats" value="99%" description="accuracy rate" />
|
|
554
|
+
<AfTestimonialStat
|
|
620
555
|
slot="stats"
|
|
621
556
|
value=""
|
|
622
557
|
description="Reduced manual errors significantly"
|
|
@@ -626,21 +561,21 @@ import { getIllustrationUrlByScene } from '@affinda/illustrations';
|
|
|
626
561
|
|
|
627
562
|
#### Branding
|
|
628
563
|
|
|
629
|
-
**
|
|
564
|
+
**AfLogo**
|
|
630
565
|
- Affinda logo component with consistent sizing
|
|
631
|
-
- Use in
|
|
566
|
+
- Use in AfNavbar and footer
|
|
632
567
|
- Renders as inline SVG for crisp display at any size
|
|
633
568
|
|
|
634
569
|
```tsx
|
|
635
|
-
<
|
|
570
|
+
<AfLogo />
|
|
636
571
|
```
|
|
637
572
|
|
|
638
|
-
**
|
|
573
|
+
**AfColorSwatch**
|
|
639
574
|
- Display color palettes or design tokens
|
|
640
575
|
- Useful for style guides and documentation
|
|
641
576
|
|
|
642
577
|
```tsx
|
|
643
|
-
<
|
|
578
|
+
<AfColorSwatch color="#C6D5D1" label="Mist Green" />
|
|
644
579
|
```
|
|
645
580
|
|
|
646
581
|
### Icons
|
|
@@ -658,28 +593,28 @@ import {
|
|
|
658
593
|
|
|
659
594
|
## Example Usage
|
|
660
595
|
|
|
661
|
-
### Basic
|
|
596
|
+
### Basic AfButton
|
|
662
597
|
|
|
663
598
|
```tsx
|
|
664
|
-
import {
|
|
599
|
+
import { AfButton } from '@affinda/react';
|
|
665
600
|
|
|
666
601
|
function App() {
|
|
667
602
|
return (
|
|
668
|
-
<
|
|
603
|
+
<AfButton variant="primary" size="default">
|
|
669
604
|
Click me
|
|
670
|
-
</
|
|
605
|
+
</AfButton>
|
|
671
606
|
);
|
|
672
607
|
}
|
|
673
608
|
```
|
|
674
609
|
|
|
675
|
-
###
|
|
610
|
+
### AfButton with Icons
|
|
676
611
|
|
|
677
612
|
```tsx
|
|
678
|
-
import {
|
|
613
|
+
import { AfButton, ArrowRightIcon } from '@affinda/react';
|
|
679
614
|
|
|
680
615
|
function App() {
|
|
681
616
|
return (
|
|
682
|
-
<
|
|
617
|
+
<AfButton variant="primary">
|
|
683
618
|
<svg slot="icon-left">
|
|
684
619
|
<ArrowRightIcon />
|
|
685
620
|
</svg>
|
|
@@ -687,19 +622,19 @@ function App() {
|
|
|
687
622
|
<svg slot="icon-right">
|
|
688
623
|
<ArrowRightIcon />
|
|
689
624
|
</svg>
|
|
690
|
-
</
|
|
625
|
+
</AfButton>
|
|
691
626
|
);
|
|
692
627
|
}
|
|
693
628
|
```
|
|
694
629
|
|
|
695
|
-
###
|
|
630
|
+
### AfTypographyLockup
|
|
696
631
|
|
|
697
632
|
```tsx
|
|
698
|
-
import {
|
|
633
|
+
import { AfTypographyLockup, AfButton } from '@affinda/react';
|
|
699
634
|
|
|
700
635
|
function Hero() {
|
|
701
636
|
return (
|
|
702
|
-
<
|
|
637
|
+
<AfTypographyLockup
|
|
703
638
|
headingSize={1}
|
|
704
639
|
breakpoint="desktop"
|
|
705
640
|
textAlignment="center"
|
|
@@ -709,9 +644,9 @@ function Hero() {
|
|
|
709
644
|
<p slot="description">
|
|
710
645
|
Extract data from documents with AI-powered accuracy
|
|
711
646
|
</p>
|
|
712
|
-
<
|
|
713
|
-
<
|
|
714
|
-
</
|
|
647
|
+
<AfButton slot="buttons" variant="primary">Get Started</AfButton>
|
|
648
|
+
<AfButton slot="buttons" variant="secondary">Learn More</AfButton>
|
|
649
|
+
</AfTypographyLockup>
|
|
715
650
|
);
|
|
716
651
|
}
|
|
717
652
|
```
|
|
@@ -719,27 +654,27 @@ function Hero() {
|
|
|
719
654
|
### Navigation
|
|
720
655
|
|
|
721
656
|
```tsx
|
|
722
|
-
import {
|
|
657
|
+
import { AfNavbar, AfNavItem, AfButton } from '@affinda/react';
|
|
723
658
|
|
|
724
659
|
function Header() {
|
|
725
660
|
return (
|
|
726
|
-
//
|
|
727
|
-
<
|
|
661
|
+
// AfNavbar displays the default Affinda logo automatically
|
|
662
|
+
<AfNavbar>
|
|
728
663
|
<div slot="start">
|
|
729
|
-
<
|
|
664
|
+
<AfNavItem hierarchy="primary" variant="01" href="/">
|
|
730
665
|
Home
|
|
731
|
-
</
|
|
732
|
-
<
|
|
666
|
+
</AfNavItem>
|
|
667
|
+
<AfNavItem hierarchy="primary" variant="01" href="/products">
|
|
733
668
|
Products
|
|
734
|
-
</
|
|
669
|
+
</AfNavItem>
|
|
735
670
|
</div>
|
|
736
671
|
<div slot="end">
|
|
737
|
-
<
|
|
672
|
+
<AfNavItem hierarchy="primary" variant="02" href="/docs">
|
|
738
673
|
Documentation
|
|
739
|
-
</
|
|
674
|
+
</AfNavItem>
|
|
740
675
|
</div>
|
|
741
|
-
<
|
|
742
|
-
</
|
|
676
|
+
<AfButton slot="button" variant="primary">Get Started</AfButton>
|
|
677
|
+
</AfNavbar>
|
|
743
678
|
);
|
|
744
679
|
}
|
|
745
680
|
```
|
|
@@ -803,16 +738,16 @@ Full TypeScript type definitions are included for all components and props.
|
|
|
803
738
|
All components accept a `style` prop for applying inline CSS styles directly to the component's root element:
|
|
804
739
|
|
|
805
740
|
```tsx
|
|
806
|
-
import {
|
|
741
|
+
import { AfButton, AfSection, AfHeading } from '@affinda/react';
|
|
807
742
|
|
|
808
743
|
// Apply custom styles to any component
|
|
809
|
-
<
|
|
744
|
+
<AfButton variant="primary" style={{ marginTop: '20px', opacity: 0.9 }}>
|
|
810
745
|
Custom Styled Button
|
|
811
|
-
</
|
|
746
|
+
</AfButton>
|
|
812
747
|
|
|
813
|
-
<
|
|
814
|
-
<
|
|
815
|
-
</
|
|
748
|
+
<AfSection theme="white" style={{ borderRadius: '16px', boxShadow: '0 4px 12px rgba(0,0,0,0.1)' }}>
|
|
749
|
+
<AfHeading level="2">Styled Section</AfHeading>
|
|
750
|
+
</AfSection>
|
|
816
751
|
```
|
|
817
752
|
|
|
818
753
|
The `style` prop is passed through to the web component's host element, allowing you to override or extend component styles as needed.
|
|
@@ -824,114 +759,122 @@ Use these component combinations for common marketing page patterns. **Always ch
|
|
|
824
759
|
### Grid of Feature Items with Icons
|
|
825
760
|
|
|
826
761
|
```tsx
|
|
827
|
-
import {
|
|
762
|
+
import { AfSection, AfFeatureGrid, AfIconText } from '@affinda/react';
|
|
828
763
|
|
|
829
|
-
<
|
|
830
|
-
<
|
|
831
|
-
<
|
|
764
|
+
<AfSection theme="mist-green" container={true}>
|
|
765
|
+
<AfFeatureGrid columns={4} mobileLayout="list">
|
|
766
|
+
<AfIconText icon="time" headingSize={4}>
|
|
832
767
|
Fast Processing
|
|
833
768
|
<span slot="description">Process documents in seconds.</span>
|
|
834
|
-
</
|
|
835
|
-
<
|
|
769
|
+
</AfIconText>
|
|
770
|
+
<AfIconText icon="verification-01" headingSize={4}>
|
|
836
771
|
High Accuracy
|
|
837
772
|
<span slot="description">99%+ extraction accuracy.</span>
|
|
838
|
-
</
|
|
839
|
-
<
|
|
773
|
+
</AfIconText>
|
|
774
|
+
<AfIconText icon="security-01" headingSize={4}>
|
|
840
775
|
Secure & Compliant
|
|
841
776
|
<span slot="description">Enterprise-grade security.</span>
|
|
842
|
-
</
|
|
843
|
-
<
|
|
777
|
+
</AfIconText>
|
|
778
|
+
<AfIconText icon="code" headingSize={4}>
|
|
844
779
|
Easy Integration
|
|
845
780
|
<span slot="description">Works with your existing systems.</span>
|
|
846
|
-
</
|
|
847
|
-
</
|
|
848
|
-
</
|
|
781
|
+
</AfIconText>
|
|
782
|
+
</AfFeatureGrid>
|
|
783
|
+
</AfSection>
|
|
849
784
|
```
|
|
850
785
|
|
|
851
786
|
### Grid of Feature Cards with Images
|
|
852
787
|
|
|
853
788
|
```tsx
|
|
854
|
-
import {
|
|
789
|
+
import { AfFeatureGrid, AfFeatureCard } from '@affinda/react';
|
|
855
790
|
|
|
856
|
-
<
|
|
857
|
-
<
|
|
791
|
+
<AfFeatureGrid columns={3} mobileLayout="scroll">
|
|
792
|
+
<AfFeatureCard theme="mist-green" cardSize="flexible" imageSrc="/feature1.jpg">
|
|
858
793
|
Extract Any Document
|
|
859
794
|
<span slot="body">AI-powered extraction for all document types.</span>
|
|
860
|
-
</
|
|
861
|
-
<
|
|
795
|
+
</AfFeatureCard>
|
|
796
|
+
<AfFeatureCard theme="soft-clay" cardSize="flexible" imageSrc="/feature2.jpg">
|
|
862
797
|
Validate Automatically
|
|
863
798
|
<span slot="body">Built-in validation catches errors.</span>
|
|
864
|
-
</
|
|
865
|
-
</
|
|
799
|
+
</AfFeatureCard>
|
|
800
|
+
</AfFeatureGrid>
|
|
866
801
|
```
|
|
867
802
|
|
|
868
803
|
### Grouped Buttons
|
|
869
804
|
|
|
870
805
|
```tsx
|
|
871
|
-
import {
|
|
806
|
+
import { AfButtonGroup, AfButton } from '@affinda/react';
|
|
872
807
|
|
|
873
|
-
<
|
|
874
|
-
<
|
|
875
|
-
<
|
|
876
|
-
</
|
|
808
|
+
<AfButtonGroup direction="horizontal" gap="16px">
|
|
809
|
+
<AfButton variant="primary">Get Started</AfButton>
|
|
810
|
+
<AfButton variant="secondary">Learn More</AfButton>
|
|
811
|
+
</AfButtonGroup>
|
|
877
812
|
```
|
|
878
813
|
|
|
879
814
|
### Feature Section with Image + Grid of Items
|
|
880
815
|
|
|
881
816
|
```tsx
|
|
882
|
-
import {
|
|
817
|
+
import { AfSection, AfGridCallout, AfIconText, AfButton } from '@affinda/react';
|
|
883
818
|
|
|
884
|
-
<
|
|
885
|
-
<
|
|
819
|
+
<AfSection theme="white" container={true}>
|
|
820
|
+
<AfGridCallout imageSrc="/team.jpg" imagePosition="left" columns={2}>
|
|
886
821
|
Why Choose Affinda
|
|
887
822
|
<span slot="description">Industry-leading AI for document processing.</span>
|
|
888
823
|
|
|
889
|
-
<
|
|
824
|
+
<AfIconText slot="items" icon="sparkle" headingSize={4}>
|
|
890
825
|
AI-Powered
|
|
891
826
|
<span slot="description">State-of-the-art machine learning.</span>
|
|
892
|
-
</
|
|
893
|
-
<
|
|
827
|
+
</AfIconText>
|
|
828
|
+
<AfIconText slot="items" icon="security-01" headingSize={4}>
|
|
894
829
|
Enterprise Security
|
|
895
830
|
<span slot="description">SOC 2 Type II certified.</span>
|
|
896
|
-
</
|
|
831
|
+
</AfIconText>
|
|
897
832
|
|
|
898
|
-
<
|
|
899
|
-
</
|
|
900
|
-
</
|
|
833
|
+
<AfButton slot="cta" variant="primary">Learn More</AfButton>
|
|
834
|
+
</AfGridCallout>
|
|
835
|
+
</AfSection>
|
|
901
836
|
```
|
|
902
837
|
|
|
903
838
|
### Icons in Feature Lists
|
|
904
839
|
|
|
905
840
|
```tsx
|
|
906
|
-
import {
|
|
841
|
+
import { AfIconBox, AfIconText } from '@affinda/react';
|
|
907
842
|
|
|
908
843
|
// Standalone icons
|
|
909
|
-
<
|
|
844
|
+
<AfIconBox icon="verification-01" size="default" />
|
|
910
845
|
|
|
911
846
|
// Icon + text combinations
|
|
912
|
-
<
|
|
847
|
+
<AfIconText icon="time" headingSize={4}>
|
|
913
848
|
Fast Processing
|
|
914
849
|
<span slot="description">Documents processed in seconds.</span>
|
|
915
|
-
</
|
|
850
|
+
</AfIconText>
|
|
916
851
|
```
|
|
917
852
|
|
|
918
|
-
### Hero
|
|
853
|
+
### Hero Section (Recipe)
|
|
854
|
+
|
|
855
|
+
Hero sections are composed from `AfSection` + `AfContainer` + `AfTypographyLockup`:
|
|
919
856
|
|
|
920
857
|
```tsx
|
|
921
|
-
import {
|
|
922
|
-
|
|
923
|
-
<
|
|
924
|
-
<
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
</
|
|
858
|
+
import { AfSection, AfContainer, AfTypographyLockup, AfHeading, AfText, AfButtonGroup, AfButton } from '@affinda/react';
|
|
859
|
+
|
|
860
|
+
<AfSection theme="inkwell" padding="loose" style={{ minHeight: '80vh' }}>
|
|
861
|
+
<AfContainer>
|
|
862
|
+
<AfTypographyLockup headingSize={1} textAlignment="center">
|
|
863
|
+
<AfHeading level="1">Document Automation</AfHeading>
|
|
864
|
+
<AfText slot="description" variant="large">
|
|
865
|
+
Extract data from any document with AI.
|
|
866
|
+
</AfText>
|
|
867
|
+
<AfButtonGroup slot="buttons" direction="horizontal" gap="16px">
|
|
868
|
+
<AfButton variant="primary">Start Free Trial</AfButton>
|
|
869
|
+
<AfButton variant="secondary">Watch Demo</AfButton>
|
|
870
|
+
</AfButtonGroup>
|
|
871
|
+
</AfTypographyLockup>
|
|
872
|
+
</AfContainer>
|
|
873
|
+
</AfSection>
|
|
933
874
|
```
|
|
934
875
|
|
|
876
|
+
This composition pattern gives you full control over each layer while maintaining consistent spacing and theme inheritance.
|
|
877
|
+
|
|
935
878
|
---
|
|
936
879
|
|
|
937
880
|
## For AI Agents
|
|
@@ -944,20 +887,20 @@ When generating Affinda UI code:
|
|
|
944
887
|
|
|
945
888
|
| If you need... | Use this component |
|
|
946
889
|
|----------------|-------------------|
|
|
947
|
-
| Grid of items | `
|
|
948
|
-
| Card with icon + text | `
|
|
949
|
-
| Standalone icon | `
|
|
950
|
-
| Card with photo/screenshot | `
|
|
951
|
-
| Card with @affinda/illustrations | `
|
|
952
|
-
| Button group | `
|
|
953
|
-
| Heading + description + buttons | `
|
|
954
|
-
| Section with image + feature grid | `
|
|
955
|
-
| Two-column layout | `
|
|
956
|
-
| Responsive grid container | `
|
|
890
|
+
| Grid of items | `AfFeatureGrid` |
|
|
891
|
+
| Card with icon + text | `AfIconText` |
|
|
892
|
+
| Standalone icon | `AfIconBox` |
|
|
893
|
+
| Card with photo/screenshot | `AfFeatureCard` |
|
|
894
|
+
| Card with @affinda/illustrations | `AfIllustratedCard` |
|
|
895
|
+
| Button group | `AfButtonGroup` |
|
|
896
|
+
| Heading + description + buttons | `AfTypographyLockup` |
|
|
897
|
+
| Section with image + feature grid | `AfGridCallout` |
|
|
898
|
+
| Two-column layout | `AfSplitSection` |
|
|
899
|
+
| Responsive grid container | `AfFeatureGrid` with `mobileLayout` prop |
|
|
957
900
|
|
|
958
901
|
### Available Icons
|
|
959
902
|
|
|
960
|
-
Use icons from `@affinda/icons` with `
|
|
903
|
+
Use icons from `@affinda/icons` with `AfIconBox` or `AfIconText`. Never use emoji.
|
|
961
904
|
|
|
962
905
|
**Common icons:**
|
|
963
906
|
- `time` - speed/performance
|
|
@@ -973,14 +916,14 @@ Use icons from `@affinda/icons` with `IconBox` or `IconText`. Never use emoji.
|
|
|
973
916
|
- `gear` - settings/configuration
|
|
974
917
|
|
|
975
918
|
```tsx
|
|
976
|
-
// Use with
|
|
977
|
-
<
|
|
919
|
+
// Use with AfIconBox
|
|
920
|
+
<AfIconBox icon="verification-01" size="default" />
|
|
978
921
|
|
|
979
|
-
// Use with
|
|
980
|
-
<
|
|
922
|
+
// Use with AfIconText
|
|
923
|
+
<AfIconText icon="sparkle" headingSize={4}>
|
|
981
924
|
AI-Powered Processing
|
|
982
925
|
<span slot="description">State-of-the-art machine learning.</span>
|
|
983
|
-
</
|
|
926
|
+
</AfIconText>
|
|
984
927
|
```
|
|
985
928
|
|
|
986
929
|
### Theme System (Important!)
|
|
@@ -988,14 +931,42 @@ Use icons from `@affinda/icons` with `IconBox` or `IconText`. Never use emoji.
|
|
|
988
931
|
Use the 4-value theme system on container components. Child components inherit colors automatically:
|
|
989
932
|
|
|
990
933
|
```tsx
|
|
991
|
-
<
|
|
992
|
-
<
|
|
993
|
-
<
|
|
994
|
-
<
|
|
995
|
-
</
|
|
934
|
+
<AfSection theme="inkwell">
|
|
935
|
+
<AfHeading level="2">Title</AfHeading> {/* Automatically light text */}
|
|
936
|
+
<AfText>Content</AfText> {/* Automatically light text */}
|
|
937
|
+
<AfButton variant="primary">Action</AfButton> {/* Automatically themed */}
|
|
938
|
+
</AfSection>
|
|
996
939
|
```
|
|
997
940
|
|
|
998
|
-
**Available themes:** `"white"` | `"inkwell"` | `"mist-green"` | `"soft-clay"`
|
|
941
|
+
**Available themes:** `"white"` | `"inkwell"` | `"mist-green"` | `"soft-clay"` | `"white-ivory"`
|
|
942
|
+
|
|
943
|
+
### Theme Override
|
|
944
|
+
|
|
945
|
+
Use `AfThemeOverride` to explicitly set a theme for child components, overriding any inherited theme from parent containers. This is useful when you need specific components to use a different theme than their container.
|
|
946
|
+
|
|
947
|
+
```tsx
|
|
948
|
+
<AfSection theme="inkwell">
|
|
949
|
+
<AfHeading level="1">Inherits inkwell theme</AfHeading>
|
|
950
|
+
|
|
951
|
+
{/* Override just this button to use white theme colors */}
|
|
952
|
+
<AfThemeOverride theme="white">
|
|
953
|
+
<AfButton variant="secondary">Uses white theme</AfButton>
|
|
954
|
+
</AfThemeOverride>
|
|
955
|
+
</AfSection>
|
|
956
|
+
```
|
|
957
|
+
|
|
958
|
+
You can also wrap multiple components:
|
|
959
|
+
|
|
960
|
+
```tsx
|
|
961
|
+
<AfSection theme="mist-green">
|
|
962
|
+
<AfThemeOverride theme="inkwell">
|
|
963
|
+
<AfHeading level="2">Dark heading on green background</AfHeading>
|
|
964
|
+
<AfText>Dark text styling</AfText>
|
|
965
|
+
</AfThemeOverride>
|
|
966
|
+
</AfSection>
|
|
967
|
+
```
|
|
968
|
+
|
|
969
|
+
**Note:** `AfThemeOverride` only sets the CSS custom properties for child component colors — it does NOT change the background color. The visual background remains from the parent container.
|
|
999
970
|
|
|
1000
971
|
### Self-Theming Components (No Section Wrapper!)
|
|
1001
972
|
|
|
@@ -1003,38 +974,63 @@ Some components provide their own themed backgrounds. **Do NOT wrap these in a S
|
|
|
1003
974
|
|
|
1004
975
|
| Component | Provides Own Background | Correct Usage |
|
|
1005
976
|
|-----------|------------------------|---------------|
|
|
1006
|
-
| `
|
|
1007
|
-
| `
|
|
1008
|
-
|
|
977
|
+
| `AfClientCarousel` | Yes | Use directly, set `theme` prop to match adjacent section |
|
|
978
|
+
| `AfInPageBanner` | Yes | Wrap in neutral `AfSection theme="white"` to show contrast |
|
|
979
|
+
|
|
980
|
+
```tsx
|
|
981
|
+
<AfClientCarousel theme="inkwell">...</AfClientCarousel>
|
|
982
|
+
```
|
|
983
|
+
|
|
984
|
+
### AfClientCarousel Theme Matching
|
|
985
|
+
|
|
986
|
+
When using `AfClientCarousel`, set its `theme` prop to match the section **above** it for visual continuity. This creates a seamless transition between sections.
|
|
1009
987
|
|
|
1010
988
|
```tsx
|
|
1011
|
-
|
|
989
|
+
{/* Hero section using composition pattern */}
|
|
990
|
+
<AfSection theme="inkwell" padding="loose">
|
|
991
|
+
<AfContainer>
|
|
992
|
+
<AfTypographyLockup headingSize={1} textAlignment="center">
|
|
993
|
+
{/* Hero content */}
|
|
994
|
+
</AfTypographyLockup>
|
|
995
|
+
</AfContainer>
|
|
996
|
+
</AfSection>
|
|
997
|
+
<AfClientCarousel theme="inkwell">
|
|
998
|
+
{/* Logo wells - theme matches preceding section */}
|
|
999
|
+
</AfClientCarousel>
|
|
1012
1000
|
```
|
|
1013
1001
|
|
|
1014
|
-
###
|
|
1002
|
+
### AfSplitSection Theme Context
|
|
1015
1003
|
|
|
1016
|
-
|
|
1004
|
+
`AfSplitSection` creates a two-tone background split at 50%. By default, child content inherits the **top theme's** colors. When content visually sits in the bottom half, wrap it with `AfThemeOverride` to use the appropriate theme colors:
|
|
1017
1005
|
|
|
1018
1006
|
```tsx
|
|
1019
|
-
<
|
|
1020
|
-
{/*
|
|
1021
|
-
</
|
|
1022
|
-
|
|
1023
|
-
{/*
|
|
1024
|
-
|
|
1007
|
+
<AfSplitSection topTheme="inkwell" bottomTheme="white">
|
|
1008
|
+
{/* Header in top half - uses inherited inkwell theme (light text) */}
|
|
1009
|
+
<AfHeading level="2">Dark Header</AfHeading>
|
|
1010
|
+
|
|
1011
|
+
{/* Card in bottom half - override to white theme for proper contrast */}
|
|
1012
|
+
<AfThemeOverride theme="white">
|
|
1013
|
+
<AfCard theme="white">
|
|
1014
|
+
<AfHeading level="3">Card Content</AfHeading>
|
|
1015
|
+
<AfButton variant="primary">Action</AfButton>
|
|
1016
|
+
</AfCard>
|
|
1017
|
+
</AfThemeOverride>
|
|
1018
|
+
</AfSplitSection>
|
|
1025
1019
|
```
|
|
1026
1020
|
|
|
1027
|
-
|
|
1021
|
+
This pattern gives you full control over which theme context each piece of content uses, regardless of its visual position.
|
|
1022
|
+
|
|
1023
|
+
### AfFeatureAccordion (Wrap in AfSection!)
|
|
1028
1024
|
|
|
1029
|
-
Unlike self-theming components, `
|
|
1025
|
+
Unlike self-theming components, `AfFeatureAccordion` should be wrapped in an `AfSection` which provides the theme context, padding, and container.
|
|
1030
1026
|
|
|
1031
1027
|
```tsx
|
|
1032
|
-
<
|
|
1033
|
-
<
|
|
1028
|
+
<AfSection theme="soft-clay" padding="default">
|
|
1029
|
+
<AfFeatureAccordion
|
|
1034
1030
|
heading="Give AI agents your paperwork"
|
|
1035
1031
|
items={JSON.stringify([...])}
|
|
1036
1032
|
/>
|
|
1037
|
-
</
|
|
1033
|
+
</AfSection>
|
|
1038
1034
|
```
|
|
1039
1035
|
|
|
1040
1036
|
### Slot-Based Components
|
|
@@ -1042,26 +1038,26 @@ Unlike self-theming components, `FeatureAccordion` should be wrapped in a `Secti
|
|
|
1042
1038
|
Several components require `slot` attributes on children:
|
|
1043
1039
|
|
|
1044
1040
|
```tsx
|
|
1045
|
-
//
|
|
1046
|
-
<
|
|
1047
|
-
<div slot="start"><
|
|
1048
|
-
<
|
|
1049
|
-
</
|
|
1050
|
-
|
|
1051
|
-
//
|
|
1052
|
-
//
|
|
1053
|
-
//
|
|
1054
|
-
//
|
|
1041
|
+
// AfNavbar slots: logo, start, end, button
|
|
1042
|
+
<AfNavbar>
|
|
1043
|
+
<div slot="start"><AfNavItem href="/">Home</AfNavItem></div>
|
|
1044
|
+
<AfButton slot="button">CTA</AfButton>
|
|
1045
|
+
</AfNavbar>
|
|
1046
|
+
|
|
1047
|
+
// AfFooter slots: logo, social, contact, nav, legal, badges
|
|
1048
|
+
// AfClientCarousel slots: row-1, row-2
|
|
1049
|
+
// AfButton slots: icon-left, icon-right
|
|
1050
|
+
// AfTypographyLockup slots: description, buttons
|
|
1055
1051
|
```
|
|
1056
1052
|
|
|
1057
|
-
###
|
|
1053
|
+
### AfFeatureAccordion Items
|
|
1058
1054
|
|
|
1059
1055
|
The `items` prop requires JSON.stringify():
|
|
1060
1056
|
|
|
1061
1057
|
```tsx
|
|
1062
|
-
<
|
|
1063
|
-
<
|
|
1064
|
-
</
|
|
1058
|
+
<AfSection theme="mist-green" padding="default">
|
|
1059
|
+
<AfFeatureAccordion items={JSON.stringify([{ title: "...", description: "..." }])} />
|
|
1060
|
+
</AfSection>
|
|
1065
1061
|
```
|
|
1066
1062
|
|
|
1067
1063
|
### Brand Colors
|
|
@@ -1085,21 +1081,21 @@ The `items` prop requires JSON.stringify():
|
|
|
1085
1081
|
|
|
1086
1082
|
4. **Never use purple colors** - those were placeholder colors and have been removed
|
|
1087
1083
|
|
|
1088
|
-
###
|
|
1084
|
+
### AfFooter
|
|
1089
1085
|
|
|
1090
1086
|
A flexible, slot-based footer component for composing marketing page footers.
|
|
1091
1087
|
|
|
1092
1088
|
```tsx
|
|
1093
1089
|
import {
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1090
|
+
AfFooter,
|
|
1091
|
+
AfFooterColumn,
|
|
1092
|
+
AfFooterLink,
|
|
1093
|
+
AfSocialLink,
|
|
1094
|
+
AfContactItem,
|
|
1095
|
+
AfLogo
|
|
1100
1096
|
} from '@affinda/react';
|
|
1101
1097
|
|
|
1102
|
-
<
|
|
1098
|
+
<AfFooter
|
|
1103
1099
|
copyrightText="© 2025 Your Company. All rights reserved."
|
|
1104
1100
|
statusText="All systems are operational"
|
|
1105
1101
|
statusUrl="https://status.example.com"
|
|
@@ -1107,33 +1103,33 @@ import {
|
|
|
1107
1103
|
showStatus={true}
|
|
1108
1104
|
>
|
|
1109
1105
|
{/* Logo */}
|
|
1110
|
-
<
|
|
1106
|
+
<AfLogo slot="logo" />
|
|
1111
1107
|
|
|
1112
1108
|
{/* Social Links */}
|
|
1113
1109
|
<div slot="social" style={{ display: 'flex', gap: '12px' }}>
|
|
1114
|
-
<
|
|
1115
|
-
<
|
|
1116
|
-
<
|
|
1110
|
+
<AfSocialLink href="https://linkedin.com/company/..." icon="linkedin" label="LinkedIn" />
|
|
1111
|
+
<AfSocialLink href="https://youtube.com/..." icon="youtube" label="YouTube" />
|
|
1112
|
+
<AfSocialLink href="https://github.com/..." icon="github" label="GitHub" />
|
|
1117
1113
|
</div>
|
|
1118
1114
|
|
|
1119
1115
|
{/* Contact Info */}
|
|
1120
1116
|
<div slot="contact" style={{ display: 'flex', flexDirection: 'column', gap: '20px' }}>
|
|
1121
|
-
<
|
|
1122
|
-
<
|
|
1117
|
+
<AfContactItem label="Sales enquiries" value="sales@example.com" />
|
|
1118
|
+
<AfContactItem label="Support" value="support@example.com" />
|
|
1123
1119
|
</div>
|
|
1124
1120
|
|
|
1125
1121
|
{/* Navigation Columns */}
|
|
1126
1122
|
<div slot="nav" style={{ display: 'contents' }}>
|
|
1127
|
-
<
|
|
1128
|
-
<
|
|
1129
|
-
<
|
|
1130
|
-
</
|
|
1131
|
-
|
|
1132
|
-
<
|
|
1133
|
-
<
|
|
1134
|
-
<
|
|
1135
|
-
<
|
|
1136
|
-
</
|
|
1123
|
+
<AfFooterColumn heading="Products">
|
|
1124
|
+
<AfFooterLink href="/product-a">Product A</AfFooterLink>
|
|
1125
|
+
<AfFooterLink href="/product-b">Product B</AfFooterLink>
|
|
1126
|
+
</AfFooterColumn>
|
|
1127
|
+
|
|
1128
|
+
<AfFooterColumn heading="Company">
|
|
1129
|
+
<AfFooterLink href="/about">About</AfFooterLink>
|
|
1130
|
+
<AfFooterLink href="/careers">Careers</AfFooterLink>
|
|
1131
|
+
<AfFooterLink href="https://external.com" external>Partner Site</AfFooterLink>
|
|
1132
|
+
</AfFooterColumn>
|
|
1137
1133
|
</div>
|
|
1138
1134
|
|
|
1139
1135
|
{/* Legal Links */}
|
|
@@ -1146,7 +1142,7 @@ import {
|
|
|
1146
1142
|
<div slot="badges">
|
|
1147
1143
|
{/* Your certification badge SVGs or images */}
|
|
1148
1144
|
</div>
|
|
1149
|
-
</
|
|
1145
|
+
</AfFooter>
|
|
1150
1146
|
```
|
|
1151
1147
|
|
|
1152
1148
|
**Footer Props:**
|
|
@@ -1166,16 +1162,16 @@ import {
|
|
|
1166
1162
|
|
|
1167
1163
|
**Helper Components:**
|
|
1168
1164
|
|
|
1169
|
-
- **
|
|
1165
|
+
- **AfFooterColumn**: Navigation column with heading
|
|
1170
1166
|
- Props: `heading` (string)
|
|
1171
1167
|
|
|
1172
|
-
- **
|
|
1168
|
+
- **AfFooterLink**: Styled footer link
|
|
1173
1169
|
- Props: `href` (string), `external` (boolean - adds external link icon)
|
|
1174
1170
|
|
|
1175
|
-
- **
|
|
1171
|
+
- **AfSocialLink**: Circular social media icon link
|
|
1176
1172
|
- Props: `href`, `label`, `icon` ('linkedin' | 'youtube' | 'github' | 'twitter' | 'facebook' | 'custom')
|
|
1177
1173
|
|
|
1178
|
-
- **
|
|
1174
|
+
- **AfContactItem**: Label + value pair for contact info
|
|
1179
1175
|
- Props: `label`, `value`
|
|
1180
1176
|
|
|
1181
1177
|
**Features:**
|