Skip to main content

UI Guidelines

Your app renders inside the Hootsuite dashboard, next to Hootsuite's own UI. Build it with Bento, Hootsuite's design system, so it looks and behaves like the rest of the product. Apps must also meet WCAG 2.1 Level AA.


Use Bento​

The template includes Bento as the hootsuite-bento package. It provides layout primitives (Box, Flex), form controls (FormControl, InputText, SingleSelect, Checkbox, …), lists (List, VirtualizedList), feedback (EmptyState, FeedbackStatus, Spinner, SkeletonText, ProgressBar), and more.

  • Import components only from hootsuite-bento. Other Hootsuite design-system packages are not available outside Hootsuite.
  • Run npm run storybook to browse every component in the package, with its variants and accessibility notes, on port 6006. Storybook includes an accessibility checker panel.
  • Your editor gets TypeScript types for every component from the same package.

Load the theme and icons​

Call loadTheme('light') once at startup. The template does this in src/App.tsx. Without it, design tokens have no values and components render unstyled.

If you use the Icon component, also call loadMaterialSymbols(). Without the Material Symbols font, icons appear as plain text.

import { loadMaterialSymbols, loadTheme } from 'hootsuite-bento';

loadTheme('light');
loadMaterialSymbols();

Load both from code. The dev server's public/index.html is not part of the uploaded bundle. The theme and the icon font are downloaded at runtime from the network.

Lists​

Use List, List.Item, and List.Section. The list item slots are exported as ListItemLabel and ListItemMedia, so they do not collide with the form Label and the Media components:

import { List, ListItemLabel, ListItemMedia } from 'hootsuite-bento';

<List aria-label="Campaigns">
<List.Item textValue="Campaign A">
<ListItemMedia iconProps={{ name: 'favorite' }} />
<ListItemLabel>Campaign A</ListItemLabel>
</List.Item>
</List>;

Use VirtualizedList for long collections.

Known limitations of hootsuite-bento​

The template ships hootsuite-bento version 0.0.5. Keep these limitations in mind:

  • No button sizes. Button, IconButton, and ToggleIconButton have no size prop, and the package does not export a ButtonSize type. Buttons always render at the standard height. Both were removed in version 0.0.4, so code written for an earlier version that uses them no longer compiles.
  • Stepper and TS4023. The props of Stepper refer to a type that the package does not export. If you export a value whose inferred type includes those props, npm run lint:types can fail with TS4023, because the template's tsconfig.json generates declarations. Give the exported value an explicit type, for example a React.ReactElement return type on your component.

Use design tokens​

Use Bento design tokens for color, spacing, typography, radius, and elevation instead of raw hex values or pixel sizes. Tokens keep your app consistent with the dashboard and pick up theme changes.

  • On Box and Flex, use props such as padding, margin, gap, color, backgroundColor, borderRadius, boxShadow, and typography with token values:

    import { Box, Flex } from 'hootsuite-bento';

    <Flex as="main" flexDirection="column" gap="4" padding="4">
    <Box as="h1" margin="0" typography="hs-sys-title-subsection" color="text-base">
    Tasks
    </Box>
    <Box typography="hs-sys-text-base-medium" color="text-subtle">
    Tasks due this week
    </Box>
    </Flex>;
  • For CSS that has no matching prop, use token(), which returns a CSS variable reference:

    import { token } from 'hootsuite-bento';

    const background = token('hs-global-color-fill-base'); // 'var(--hs-global-color-fill-base)'
  • Prefer a prop over attributes={{ style: … }} whenever a prop exists.


Layout​

  • The template's ScrollContainer fills the iframe and scrolls its content vertically. Wrap each page in it so long content scrolls inside your app.
  • Apps can render in narrow panels, such as the Perch apps drawer. Use flexible layouts, let text wrap or truncate, and avoid fixed widths.

Size of the app area​

In Perch and Nest, Hootsuite shows your app in the Apps drawer, a panel fixed to the right edge of the window that opens with the Open apps button. The two surfaces use the same drawer, so they give your app the same space:

Size
Width400 px. Your app fills it, with no margin or border around it.
HeightThe full height of the browser window, minus the drawer header (up to 64 px) and the Back to all apps bar above your app. Your app fills the rest.

The drawer does not resize with the window's width, but its height follows the window. Design for 400 px, and let your content scroll vertically instead of assuming a fixed height. These values are the current ones and may change, so avoid hard-coding them: use 100% widths and heights and a flexible layout.


Design every state​

An Embedded app depends on the host, the user's provider account, and your backend. Design a clear screen for each state:

StateRecommendation
Waiting for the hostRender nothing or a Spinner until isAppReady is true.
Not connectedExplain what connecting does and show a Connect button that calls requestAuthorization() from its click handler. Use isAuthorizing to show a loading state on the button.
Reconnect neededWhen needsReconnect is true, say that the connection expired and show a Reconnect button that calls requestAuthorization(). Never open the consent flow without a click. The template's Authorize page handles both this state and the previous one.
LoadingShow a Spinner or skeleton, and announce it with role="status".
EmptyExplain why there is nothing to show for the current context, for example "No tasks are due in this date range." EmptyState fits this case.
ErrorSay what failed and what the user can do, and announce it with role="alert". FeedbackStatus with statusType="error" fits full-area errors.
Missing contextIf the surface did not send the data you need, say so instead of showing an empty list.

Show host errors from appError to the user. When the consent flow fails, for example because the provider rejected the request or the browser blocked the popup, Hootsuite sends an error and the button leaves its loading state. The template stores the error in appError but its Authorize page does not display it, so without your own message the user returns to the Connect screen without any explanation.


Accessibility (WCAG 2.1 AA)​

Hootsuite requires apps to follow WCAG 2.1 Level AA. See also Best Practices.

  • Visible labels. Give every interactive control a visible label, for example with FormControl and FormControl.Label. Do not rely only on aria-label.
  • Semantic structure. Use a heading for the page title and real lists for collections. On Box and Flex, the as prop renders the right element, such as as="h1", as="ul", or as="li".
  • Live regions. Announce loading and empty states with role="status" and aria-live="polite", and errors with role="alert".
  • Keyboard. Every action must work with the keyboard, with a visible focus indicator. Bento components handle focus and keyboard interaction for you; keep using them instead of custom clickable elements.
  • Contrast. Prefer the text and fill tokens, and check the contrast of every text and background combination you use against the AA ratios.
  • Language. Write short, plain text, and do not convey information with color alone.

Use the accessibility panel in Storybook while you build, and test the finished app with a keyboard and a screen reader.

Next step​

Build, upload, and submit.