Skip to content

Help and search

Screens for finding answers: a help center and a search results page.

Installation & usage

npx @youj/cli add content-help-center

Also installs accordion, alert, app-page, badge, button, card, content-swap, counter, field, file-upload, icon-arrow-right, icon-banknote, icon-check-circle, icon-code-xml, icon-credit-card, icon-file-text, icon-mail, icon-messages, icon-phone-call, icon-search, icon-shield-alert, icon-shield-check, icon-x, input, input-group, morph-label, presence-list, radio-group, reveal, select, skeleton, spotlight, textarea, youj-core, youj-presets, youj-ui-core.

The CLI copies the block to blocks/content/help-center.tsx with every component it uses, so it’s yours to edit.

Every prop is optional and falls back to the demo, so it renders as you see it until you pass your own. Give it your data, rewrite or translate its strings through copy, and connect its actions:

helpCenter-view.tsx
'use client'

import Link from 'next/link'
import { HelpCenter, type HelpCenterProps } from '@/blocks/content/help-center'

export function HelpCenterView({ categories, articles, popular, questions }: Pick<HelpCenterProps, 'categories' | 'articles' | 'popular' | 'questions'>) {
  return (
    <HelpCenter
      categories={categories}
      articles={articles}
      popular={popular}
      questions={questions}
      copy={{ brandSuffix: 'Help' }}
      linkComponent={Link}
      onSearch={async (query) => {
        // await your API here; the block shows progress until it settles
      }}
      onSubmit={async (request) => {
        // await your API here; the block shows progress until it settles
      }}
      onUpload={async (file) => {
        // await your API here; the block shows progress until it settles
      }}
    />
  )
}

Reference

Props15 props, 6 types

Props

HelpCenter props
PropType
themeThemeInput

A theme to force on the block. Default: none, so it inherits the app's (YoujProvider or a ThemeScope around it).

–
embeddedboolean

A page in your app's frame: the shared page header (AppPage) and the frame's gutter, with no brand bar or hero of its own (the status pill moves to the header's actions).

default true

true
categoriesHelpCategory[]

The topic cards.

default Harbor's six

Harbor's six
articlesHelpArticle[]

What the search looks through by title.

default Harbor's thirteen

Harbor's thirteen
onSearch(query: string) => HelpArticle[] | Promise<HelpArticle[]>

Answers a search yourself (your search API, say); without it, articles are matched by title.

–
popularstring[]

One-press searches under the field; [] hides the row.

default four

four
questionsHelpQuestion[]

The popular questions.

default Harbor's five

Harbor's five
channelsHelpChannel[]

The ways to reach support.

default chat, email and phone

chat, email and phone
topicsHelpTopic[]

The choices under "What's this about?".

default Harbor's five

Harbor's five
onSubmit(request: HelpRequest) => Promise<string>

Sends a support request and resolves with the ticket's id; reject with an Error to say why not.

default a short demo wait

a short demo wait
onUpload(file: File) => Promise<unknown>

Uploads an attachment.

default a short demo wait

a short demo wait
brand{ name: string; logo?: ReactNode; href?: string }

The product in the header: { name, logo?, href? }. Default: Harbor.

–
statusHrefstring | null

The status pill's link; null hides it.

default '#status'

'#status'
linkComponentElementType

Renders article and topic links, e.g. Next.js Link.

default 'a'

'a'
copyPartial<HelpCenterCopy>

Any of the page's strings, to rewrite or translate.

–

HelpArticle

HelpArticle props
PropType
idRequiredstring–
titleRequiredstring–
categoryRequiredstring

A category's id; its title shows as a badge.

–
minutesRequirednumber

Reading time.

–
hrefstring

The article's page.

default `#<id>`

`#<id>`

HelpCategory

HelpCategory props
PropType
idRequiredstring–
titleRequiredstring–
descriptionRequiredstring–
countRequirednumber

How many articles it holds; counts up as it scrolls in.

–
iconRequiredHelpIcon–
hrefstring

The topic's page.

default `#<id>`

`#<id>`

HelpChannel

HelpChannel props
PropType
idRequiredstring–
titleRequiredstring–
descriptionRequiredstring–
iconRequiredHelpIcon–
replyRequirednumber

The typical first reply, in units.

–
unitRequiredstring–

HelpQuestion

HelpQuestion props
PropType
qRequiredstring–
aRequiredstring–

HelpRequest

HelpRequest props
PropType
channelRequiredstring–
topicRequiredstring–
referenceRequiredstring–
messageRequiredstring–

HelpTopic

HelpTopic props
PropType
valueRequiredstring–
labelRequiredstring–
Strings45 keys for copy

Strings

copy takes any of these keys; the rest keep their defaults. A key whose text holds a value (a count, a name) takes a function.

brandSuffixstatusstatusLinktitledescriptionsearchsearchPlaceholderclearSearchpopularresultsresultCountminutesnoResultsBeforenoResultsLinknoResultsAftertopicsarticlesfaqTitlefaqDescriptioncontactTitlecontactDescriptionchanneltypicalReplysendingdoneTitleticketdoneBodyanotherformtopictopicPlaceholdertopicRequiredreferencereferencePlaceholderreferenceHintmessagemessagePlaceholdermessageTooShortattachmentsattachmentsTitleattachmentsHintreplyByreplyChannelsendsendFailed
Built from20 components
Accessibilitylandmarks, search, filters

Accessibility

Help center has a main with one h1, a labelled search field and a status region that announces the result count as you type; the contact form announces its outcome in a live region. Search results has a main, a labelled aside of filters (a sheet on phones), labelled active-filter chips and a status region for the result count. Its query field offers suggestions in a popover, the arrow keys move between result links, and the empty and error states use a list and an alert. Links and buttons are real a and button elements with the kit’s focus ring.