woylie

woylie

I released Doggo, a collection of unstyled Phoenix components.

https://github.com/woylie/doggo

Features

  • Unstyled Phoenix components.
  • Storybook that can be added to your application, so that you can see the component with your own styles.

Goals

  • Follow proper HTML semantics.
  • Adhere to accessibility guidelines with appropriate ARIA attributes and roles.
  • Favor semantic HTML and ARIA attributes over CSS classes for style bindings to states, if possible.
  • The library is comes without default styles and does not prefer any particular CSS framework.

Why did I build it?

  • I regularly bootstrap new projects and needed a component library to quickly replace Phoenix’s tailwind-based components.
  • I prefer to solve UI problems once and use the solutions across projects.
  • I’m very comfortable writing my own CSS/SCSS and feel like I outgrow any CSS framework at some point in a project’s lifecycle.

What’s next?

  • Add stories for components that are not covered in the storybook yet.
  • Complete the base component set (#20).
  • Implement remaining APG patterns (#139).
  • Add keyboard interaction (#136).
  • Improve conformance to WAI-ARIA and WCAG.

So far, all components are plain Phoenix components without any JavaScript. For some accessibility patterns, especially those involving keyboard interaction, it may be necessary to introduce some JavaScript in the future. I might also consider introducing more complex (live) components.

Showing Posts 1 to 10

sodapopcan

sodapopcan

Nice! Big fan of your work so I’m looking forward to reading through this.

trentjones21

trentjones21

Looks cool! Do I need to do anything to generate the storybook components? I went through the installation process, but the Doggo Storybook page doesn’t have any components.

When I run

ls Path.join(:code.priv_dir(:doggo), "/storybook")

I get the error

No such file or directory <path_to_project>/_build/dev/lib/doggo/priv/storybook

I’m probably missing something obvious

Edit: I downloaded the source and manually copied the contents of priv into the build folder and that fixes the storybook file. Not sure what the right way to get it there is though.

woylie

woylie OP

I forgot to add the folder to the hex package. It should work in 0.1.3, can you try again?

lubien

lubien

Awesome work

trentjones21

trentjones21

Looks like that worked!

adw632

adw632

I have written many times my struggles on here that web UI is a huge gap and undermines Phoenix as a viable way to build apps fast. Phoenix isn’t fast vs other solutions which have established UI frameworks.

A set of semantic headless components that address accessibility is the missing piece in the ecosystem and now, with Doggo you have made great strides to closing that gap. Well done and thank-you for your efforts.

I’ve actually moved to using web components / custom elements because of this gap (Shoelace and Adobe Spectrum with the what looks to be amazing Spectrum 2 just around the corner).

IMO Doggo should be seriously considered by the Phoenix core team as a foundation library given there is nothing other than the “stop gap” core components which are not fit for purpose and create a maintenance issue for phoenix apps.

If Phoenix had a set of core semantic components which implement all the accessibility requirements correctly and cover the common application use cases then tools, generators, CSS frameworks, themes, application website templates, UI design/figma templates, and real storybook collaboration with design teams can thrive within the Phoenix ecosystem.

Without a core semantic UI component library Phoenix and liveview will remain a fringe hobby web technology with low adoption because the gap between UI design teams and dev teams is too large as they cant work effectively or efficiently together. Phoenix in effect slows you down vs just using react or next.js or any other popular solution that has established UI components and real storybook support out of the box to close the gap between design intent and devs.

14
Post #6
woylie

woylie OP

With version 0.2, all components are covered in the storybook. It also introduces three new components:

  • tab navigation
  • frame - applies an aspect ratio to an image or video
  • image - renders a figure with img and optional figcaption
adw632

adw632

Have you looked at bits-ui for inspiration in terms of structuring your headless UI components.

Bits-ui is a headless UI for accessibility concerns and is what shadcn-svelte is built on.

Some feedback:

  • consider breaking things into module concerns
  • keep drawers generic in respect of content.
  • consider semantics for drawers like left, right, top, bottom and also scoped to another container element like Shoelace does as sometimes you don’t want a drawer to be viewport scope.
  • consider generic menu lists which can be used in drop down menus, pickers, drawers etc vs drawer specific menu items.
  • consider structuring your semantic UI along similar lines to Shoelace and Adobe Spectum given the relatively large coverage and use cases. Spectum React Aria provides a good example which only covers the accessibility /Aria concerns.
woylie

woylie OP

Thanks for the feedback! I put the items on my to-do list for further consideration. I wasn’t familiar with bits-ui, I’ll definitely check it out.

In general, the goal is to define sensible primitives while still allowing the user to add further customization. The drawer component for example has three slots, but it doesn’t make any assumptions about the content of those slots. You could just use the :top slot and put any content in there, you’re not bound to the other drawer_* components. To reflect top/right/bottom/left drawers, you can add your own modifier classes (just as an example, I might consider adding a separate attribute for this in particular).

There is an open issue for a generic menu, which will follow the APG menu and menubar pattern.

adw632

adw632

Thanks for your start on this important step for the community.

I don’t pretend to be any kind of expert in this, only sharing things that struck me a well designed with good coverage.

I am kind of impressed with what Adobe is doing with Spectrum 2, I think the time of custom elements is now and they will be leading the pack with a solid approach and huge investment as they are betting the farm on it with over 100 apps to be migrated to their web components.

Despite being quite bullish on web components I see incredible value for a semantic UI contract in Phoenix.

My thoughts are that your library could in fact be the start of a completely renderless behaviour module and your current implementation could be just one rendition of the html. With the right abstraction it should be possible to back the semantic UI onto your current rendition, Shoelace, Adobe Spectrum or something else entirely, even a native UI.

Where Next? Top

Trending in Announcing Top

type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
kip
I’ll shortly be launching Text, a nascent text analysis library. Current functionality In this early version (not ready for prime time) ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews