Truss is a component library for UC Santa Cruz websites.
Note
Please note that the visual design of Truss components is dependent on the design choices in the UCSC 2022 WordPress theme.
Truss contains branded web components built with StencilJS. Truss components use the web components standard so they are cross-browser compatible.
- trss-ucsc-header (stable)
- trss-ucsc-footer (stable)
- trss-news-list (beta)
- trss-logo (stable)
- trss-site-title (beta)
- trss-events-list (experimental)
- trss-alert (stable)
- trss-breadcrumbs (beta)
- trss-card (experimental)
- trss-carousel (experimental)
The simplest way to get started with Truss is to add the released CSS and Javascript files to the bottom of your webpage.
<!-- Script and style to include Truss components. -->
<script type="module" src="https://truss.ucsc.edu/ucsc-trss/ucsc-trss.esm.js"></script>
<link rel="stylesheet" href="https://truss.ucsc.edu/ucsc-trss/ucsc-trss.css">After you've added the two files to your page, you can use any of the custom elements in Truss anywhere on your page. See the README file for each component for a list of attributes you can add to an element.
<trss-ucsc-header use-logo="true" search-action="/" search-query="s" style="--trss-content-width:80rem;"></trss-ucsc-header>Storybook is used to preview components interactively during development.
npm run storybookThis runs Stencil in watch mode alongside the Storybook dev server on http://localhost:6006. Editing a component or story file hot-reloads the preview.
To produce a static bundle for deployment:
npm run build-storybookThe output is written to storybook-static/.