Skip to content

Commit 5751fc4

Browse files
committed
Catalyst layout post
1 parent 5a5713f commit 5751fc4

File tree

6 files changed

+254
-0
lines changed

6 files changed

+254
-0
lines changed
Loading
Loading
Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
import { adamwathan } from '@/authors'
2+
import card from './card.jpg'
3+
4+
export const meta = {
5+
title: 'Catalyst: Application layouts, navigation menus, description lists, and more',
6+
description: 'We just published the first major update to Catalyst since releasing the developer preview, with two new application layouts, navbar and sidebar components, description lists, and more.',
7+
date: '2024-05-20:00:00.000Z',
8+
authors: [adamwathan],
9+
image: card,
10+
}
11+
12+
{/*excerpt*/}
13+
14+
We just published the first major update to Catalyst since releasing the developer preview, with two new application layouts, navbar and sidebar components, description lists, and more.
15+
16+
{/*/excerpt*/}
17+
18+
![Catalyst application layout preview](./catalyst-header.jpg)
19+
20+
We just published the first major update to [Catalyst](https://tailwindui.com/templates/catalyst) since releasing the developer preview, with two new application layouts, navbar and sidebar components, description lists, and more.
21+
22+
We're also pumped to share that with the release of [Headless UI v2.0 for React](/blog/headless-ui-v2), Catalyst is no longer in developer preview — **it's officially stable** and you can start using it in production today without worrying about breaking changes in the underlying dependencies.
23+
24+
Check out our brand new [live demo site](https://catalyst.tailwindui.com/demo) to see what a full Catalyst project looks and feels like after these updates for yourself.
25+
26+
---
27+
28+
## New application layout components
29+
30+
One of the hardest things about trying to get started on a new project idea is getting past the blank canvas so you can actually start building something.
31+
32+
In this update we've added two new application layout components to make it easy to give your project a shape and structure so you have something you can start building with.
33+
34+
The first layout is a classic [sidebar layout](https://catalyst.tailwindui.com/docs/sidebar-layout), that moves the sidebar into a collapsible mobile menu on smaller screens:
35+
36+
<div className="mb-0">
37+
38+
[![Sidebar layout example](./sidebar-layout.jpg)](https://catalyst.tailwindui.com/demos/sidebar)
39+
40+
</div>
41+
42+
```jsx {{ style: 'plain' }}
43+
import { SidebarLayout } from '@/components/sidebar-layout'
44+
import { Navbar } from '@/components/navbar'
45+
import { Sidebar } from '@/components/sidebar'
46+
47+
function Example({ children }) {
48+
return (
49+
<SidebarLayout
50+
sidebar={<Sidebar>{/* Sidebar menu */}</Sidebar>}
51+
navbar={<Navbar>{/* Navbar for mobile screens */}</Navbar>}
52+
>
53+
{/* Your page content */}
54+
</SidebarLayout>
55+
)
56+
}
57+
```
58+
59+
The second is a simpler [stacked layout](https://catalyst.tailwindui.com/docs/stacked-layout) with a horizontal navigation menu, which is often a great fit for apps with fewer pages:
60+
61+
<div className="mb-0">
62+
63+
[![Stacked layout example](./stacked-layout.jpg)](https://catalyst.tailwindui.com/demos/stacked)
64+
65+
</div>
66+
67+
```jsx {{ style: 'plain' }}
68+
import { StackedLayout } from '@/components/stacked-layout'
69+
import { Navbar } from '@/components/navbar'
70+
import { Sidebar } from '@/components/sidebar'
71+
72+
function Example({ children }) {
73+
return (
74+
<StackedLayout
75+
navbar={<Navbar>{/* Top navigation menu */}</Navbar>}
76+
sidebar={<Sidebar>{/* Sidebar content for mobile menu */}</Sidebar>}
77+
>
78+
{/* Your page content */}
79+
</StackedLayout>
80+
)
81+
}
82+
```
83+
84+
And they both support dark mode too, of course:
85+
86+
![Sidebar layout in dark mode](./layout-dark-mode.jpg)
87+
88+
We worked really hard to get the APIs for all of these components right, making it easy to positiong things where you need them to be, optionally include icons, incorporate dropdown menus, and more.
89+
90+
The final result turned out feeling really simple which is exactly what we were going for, and I think you'll find they are a real delight to build with.
91+
92+
Check out the [Sidebar layout documentation](https://catalyst.tailwindui.com/docs/sidebar-layout) and [Stacked layout documentation](https://catalyst.tailwindui.com/docs/stacked-layout) to get started, then dig into the [Navbar](https://catalyst.tailwindui.com/docs/navbar) and [Sidebar](https://catalyst.tailwindui.com/docs/sidebar) components to learn how to structure all of the navigation items.
93+
94+
---
95+
96+
## Description lists
97+
98+
When we were working on the application layouts we realized we didn't have any great content to demo them with, so we cooked up a `DescriptionList` component to fill in that big empty space.
99+
100+
<Example p='none'>
101+
<div class="bg-white p-8 dark:bg-slate-900">
102+
<dl
103+
class="grid grid-cols-1 text-base/6 sm:grid-cols-[min(50%,theme(spacing.80))_auto] sm:text-sm/6"
104+
>
105+
<dt
106+
class="col-start-1 border-t border-zinc-950/5 dark:border-white/5 pt-3 text-zinc-500 first:border-none sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-zinc-400"
107+
>
108+
Customer
109+
</dt>
110+
<dd
111+
class="pb-3 pt-1 text-zinc-950 sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-white sm:[&:nth-child(2)]:border-none"
112+
>
113+
Michael Foster
114+
</dd>
115+
<dt
116+
class="col-start-1 border-t border-zinc-950/5 dark:border-white/5 pt-3 text-zinc-500 first:border-none sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-zinc-400"
117+
>
118+
Event
119+
</dt>
120+
<dd
121+
class="pb-3 pt-1 text-zinc-950 sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-white sm:[&:nth-child(2)]:border-none"
122+
>
123+
Bear Hug: Live in Concert
124+
</dd>
125+
<dt
126+
class="col-start-1 border-t border-zinc-950/5 dark:border-white/5 pt-3 text-zinc-500 first:border-none sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-zinc-400"
127+
>
128+
Amount
129+
</dt>
130+
<dd
131+
class="pb-3 pt-1 text-zinc-950 sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-white sm:[&:nth-child(2)]:border-none"
132+
>
133+
$150.00 USD
134+
</dd>
135+
<dt
136+
class="col-start-1 border-t border-zinc-950/5 dark:border-white/5 pt-3 text-zinc-500 first:border-none sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-zinc-400"
137+
>
138+
Amount after exchange rate
139+
</dt>
140+
<dd
141+
class="pb-3 pt-1 text-zinc-950 sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-white sm:[&:nth-child(2)]:border-none"
142+
>
143+
US$150.00 → CA$199.79
144+
</dd>
145+
<dt
146+
class="col-start-1 border-t border-zinc-950/5 dark:border-white/5 pt-3 text-zinc-500 first:border-none sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-zinc-400"
147+
>
148+
Fee
149+
</dt>
150+
<dd
151+
class="pb-3 pt-1 text-zinc-950 sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-white sm:[&:nth-child(2)]:border-none"
152+
>
153+
$4.79 USD
154+
</dd>
155+
<dt
156+
class="col-start-1 border-t border-zinc-950/5 dark:border-white/5 pt-3 text-zinc-500 first:border-none sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-zinc-400"
157+
>
158+
Net
159+
</dt>
160+
<dd
161+
class="pb-3 pt-1 text-zinc-950 sm:border-t sm:border-zinc-950/5 sm:dark:border-white/5 sm:py-3 dark:text-white sm:[&:nth-child(2)]:border-none"
162+
>
163+
$1,955.00
164+
</dd>
165+
</dl>
166+
</div>
167+
</Example>
168+
169+
```jsx {{ style: 'plain' }}
170+
import { DescriptionDetails, DescriptionList, DescriptionTerm } from '@/components/description-list'
171+
172+
function Example() {
173+
return (
174+
<DescriptionList>
175+
<DescriptionTerm>Customer</DescriptionTerm>
176+
<DescriptionDetails>Michael Foster</DescriptionDetails>
177+
178+
<DescriptionTerm>Event</DescriptionTerm>
179+
<DescriptionDetails>Bear Hug: Live in Concert</DescriptionDetails>
180+
181+
{/* ... */}
182+
</DescriptionList>
183+
)
184+
}
185+
```
186+
187+
It's a really simple API that works just like the HTML `<dl>` element, but is nicely styled, responsive, and with dark mode support of course.
188+
189+
Check out the [Description list](https://catalyst.tailwindui.com/docs/description-list) documentation for more details.
190+
191+
---
192+
193+
## Page headings
194+
195+
More components we needed to make the demo look good! We've added `Heading` and `Subheading` components you can use to quickly and consistently title things in your UI.
196+
197+
<Example p="none">
198+
<div class="p-8 bg-white dark:bg-zinc-900">
199+
<div>
200+
<h1 class="text-2xl/8 font-semibold text-zinc-950 sm:text-xl/8 dark:text-white">Heading</h1>
201+
</div>
202+
<div class="mt-4">
203+
<h2 class="text-base/7 font-semibold text-zinc-950 sm:text-sm/6 dark:text-white">Subheading</h2>
204+
</div>
205+
</div>
206+
</Example>
207+
208+
```jsx {{ style: 'plain' }}
209+
import { Heading, Subheading } from '@/components/heading'
210+
211+
function Example() {
212+
return (
213+
<div>
214+
<Heading>Heading</Heading>
215+
<Subheading>Subheading</Subheading>
216+
</div>
217+
)
218+
}
219+
```
220+
221+
You can control with HTML heading element is rendered using the `level` prop, and like everything else, they're responsive with built-in dark mode support.
222+
223+
224+
See the [Heading](https://catalyst.tailwindui.com/docs/heading) documentation for more examples.
225+
226+
---
227+
228+
## Dividers
229+
230+
Saved the best for last — Catalyst now includes a gray line you can put in between things.
231+
232+
<Example p="none">
233+
<div class="px-8 py-16 bg-white dark:bg-zinc-900">
234+
<hr class="w-full border-t border-zinc-950/10 dark:border-white/10" />
235+
</div>
236+
</Example>
237+
238+
```jsx {{ style: 'plain' }}
239+
import { Divider } from '@/components/divider'
240+
241+
function Example() {
242+
return <Divider />
243+
}
244+
```
245+
246+
We worked tirelessly on this one, and are so proud to make this part of your application development process easier.
247+
248+
Check out the [Divider](https://catalyst.tailwindui.com/docs/divider) documentation — it does have one prop at least.
249+
250+
---
251+
252+
Catalyst is included with your Tailwind UI all-access license at no additional cost, so if you've got a license, log in and [download the latest version](https://tailwindui.com/templates/catalyst) to start building.
253+
254+
Looking forward to seeing what you do with it!
Loading
Loading
Loading

0 commit comments

Comments
 (0)