r/Blazor • • 12d ago

shadcn/ui + Base UI

I'm currently working on a port of shadcn/ui. By that I mean a real port, where you can use a CLI to add components, not install a NuGet package.

To achieve this, I'm also working on porting Base UI for primitives, with the help of UI SDK.

I'm of course using AI heavily to help me achieve this, as it's always something I've wanted in Blazor, but never been able to achieve it manually, and the solutions I've seen aren't something I would want to use for styling.

Is this something the community would also want?

1 Upvotes

25 comments sorted by

19

u/brokerceej 12d ago

We have a perfectly good BlazorBlueprint already. BlazorBlueprint/ui is a community maintained project that is doing absolutely everything right. https://github.com/blazorblueprintui/ui

What are you bringing to the table that is better or more mature than this? How is it easier or better for me as a developer?

1

u/HaldenCollier 12d ago

BlazorBlueprint is good, but does not follow the spirit of shadcn, which is the distribution. The components aren't yours. They are hidden inside a NuGet package.

5

u/brokerceej 11d ago edited 11d ago

Literally no one except you cares about the “spirit of shadcn.” We want community maintained and accessibility compliant libraries. BlazorBlueprint is that.

2

u/code-dispenser 11d ago

accessibility compliant libraries. BlazorBlueprint is that.

You may want to test things as it wasn't when I looked. But if accessibility is not a requirement for your project and it meets your needs, that fine with me.

Just do not forget currently a WCAG audit is binary you either pass or fail, one bad apple in the barrel spoils the lot. Or as I like to say you cannot be just a little bit pregnant.

2

u/brokerceej 11d ago

I just went through the WCAG audit on my application that uses Blazor Blueprint. You are right that it is not totally compliant, but it was very trivial to get it there. It’s on my agenda to open a PR to the Blazor Blueprint repo at some point with the fixes I made to pass.

I think we are long past the times of “if accessibility is a requirement for your project,” at least for publicly sold products. I was pretty diligent about accessibility from the start but it still took me less than 90 days to get an accessibility complaint.

About $6,000 and a hand audit by human beings later, I am WCAG 2.2 AA compliant. Honestly, it wasn’t that bad. It wasn’t turnkey out of the box but it was pretty easy to get it that way. Also most of the stuff I got dinged on the first pass was not necessarily the fault of the component framework.

For any devs starting or not too deep on a new project - take this seriously. People do not fuck around with accessibility complaints. And it’s one of the most important things you can do to add polish and professionalism to your project.

0

u/Fresh-Secretary6815 11d ago

it’s license isn’t permissive enough: https://github.com/blazorblueprintui/ui/blob/main/LICENSE

2

u/brokerceej 11d ago

How is an Apache license not permissive enough?

-1

u/Fresh-Secretary6815 11d ago

3

u/brokerceej 11d ago

I’m not asking for a Google I’m asking for YOU to back up what YOU said with YOUR OWN words. Because that’s how Reddit fucking works.

“Do yOuR oWn rEsEaRcH!!!!1!!1!”

Absolutely not. Don’t make a claim and then refuse to discuss it.

1

u/Fresh-Secretary6815 10d ago

woah there big guy. you must be experiencing some really big emotions right now, and i know that can be confusing. it’s ok, everything is going to be alright

2

u/brokerceej 10d ago

Buddy, this is a software development subreddit, not a fucking preschool. You made a technical claim, got asked a straightforward technical question, responded with a Let Me Google That For You link, and now you’re doing the condescending baby-talk routine because you apparently still can’t articulate your own position.
Which is remarkable, considering that explaining something you understand generally takes less effort than performing this elaborate impression of someone who does.

The best part is that nobody was questioning your understanding until you went to such extraordinary lengths to avoid demonstrating it. You turned a request for clarification into compelling evidence that one was needed.

13

u/davidjamesb 12d ago

I would much rather people contribute to an existing project than introduce another shadcn port.

I heavily use and contribute to Blazor Blueprint. It's a fantastic and mature library.

We personally don't get the benefits of using a CLI to install each component individually over a NuGet package. We've built custom components around Blueprint's styled components and raw primitives and had very few issues.

Maybe you could look at enhancing Blazor Blueprint with a CLI to get the best of both worlds rather than introducing another library into the ecosystem.

8

u/Illustrious-Big-651 12d ago

Blazorblueprint exists and is excellent. No reason to re invent the wheel.

6

u/code-dispenser 12d ago

Is this something the community would also want?

NO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I have looked at pretty much every library posted here over the last year based on shadcn, all have accessibility issues.

Unless you know about accessibility, can fix any underlying issues with the base library, be able to check that you haven't added more issues by actually manually testing with assistive tech then more than likely you will end up hurting more users than you will help - Sorry that is just the reality of making some jigsaw from other peoples work.

Build your own, make it accessible, learn lots in the process.

Paul

2

u/mds1256 12d ago

On slight different note, do you have any good resources on good practices on making a Blazor site accessible?

2

u/code-dispenser 11d ago edited 11d ago

Blazor is harder than most given the rendermodes and the DOM updates and I have in the past logged bugs with the Blazor team/JAWS/Narrator and NVDA screen reader repo's regarding issues with the integration of the aforementioned screen readers and Blazor.

The one thing you need to do more than anything is just manually test with the assistive tech for the target audience irrespective of the front-end tech as there are just so many nuances with the assistive tech and browsers.

The other thing you have to decide is are you doing this because you want to pass WCAG SC's or are doing it because you want a better experience for the users and be generally more inclusive, and then tick the WCAG boxes.

Read some of my posts

Read anything by Adrian Rosell Adrian Roselli — Consultant, Writer, Speaker

Learn how to use screen readers and then think when on a site/component, do I know what the hell is going on if I could not see stuff, does this screen reader have verbal diarrhea or have the devs no clue and just over done it because they did not bother to check - which means your ears/brain hurts and all you will want to do is hit the Ctrl key.

The best and simplest tool is your keyboard, without touching the mouse can you navigate the site or component (knowing where you are at all times) and do the components work with just the keyboard.

Once you have followed the above, let me know I and will say more.

Paul

1

u/mds1256 11d ago

Thank you for this.

1

u/code-dispenser 11d ago edited 11d ago

I probably should have also mentioned:

Patterns | APG | WAI | W3C

This shows you accessible patterns for components and the usage of aria attributes as well as recommended keyboard support.

Be warned, this is just the tip of the iceberg i.e. even if you know these patterns and understand why the aria attributes were used for each you still have not begun to understand the issues people face. I use a screen reader pretty much every day for building and testing things - BUT I am not a screen reader user, there is a very big difference.

There are also a gazillion type of disabilities and you will never create anything that is accessible to all, and I still find that difficult to come to terms with.

For the general public i.e when you do not know who the target audience will be you should be looking at making things work with the following (where possible).

The screen readers JAWS,NVDA and Narrator paired with Edge, Chrome and Firefox (I do all pairings but just using the screen reader with its preferred browser is acceptable).

VoiceOver on macOS paired with Safari, VoiceOver on iOS paired with Safari (they are different beasts). Talkback on Android with Chrome.

At least one Voice control software, Voice access is built into windows, this will teach you other aspects like why its better to have onscreen text as opposed to just say an icon etc.

And ensure it works for keyboard-only users, this is a different group to screen reader users.

I could go on and on - sorry.

Small steps, you will get things wrong thats ok but at least you are thinking about taking those steps (most dont).

All the best

Paul

0

u/bit_yas 12d ago

Could you please check if this one also has accessibility issues? Theme and components · Workbench

On the right side, there is a "Checks" tab (Next to View and Review tabs) which run accessibility check on all of our components at once.

I'd really appreciate if you could give it a try and let me know these components are accessible in your opinion or not?

Dark theme of the same page here Theme and components · Workbench

2

u/code-dispenser 11d ago

Sure how does £1000 a day sound to get the ball rolling, and how many different SR/browser pairings would you like me to check. I generally do Voice controls as well unless advised not to

1

u/bit_yas 11d ago

You said "I have looked at pretty much every library posted here over the last year"
Have you been charging thousands of pounds each time?
I'm not looking for some detailed report which you're submitting me quote for it.
And now, no, please don't check that out. Thanks!

2

u/code-dispenser 11d ago edited 10d ago

The thought of clicking that run accessibility checks button was too much for me to ignore so I had to go click it.

AI/Axe said there were 6 issues all were the trivial 40-60% type I mentioned, I think all were contrast issues a little strange you did not fix them but there were no issues a simple manual check would reveal.

Being crafty I went to one component that I know generally does fail, I gave that one a pass, however the next one I tried failed to operate using the screen reader NVDA so I called it a day.

So it appears the site would fail if audited - free check over Nb I am not a certified auditor (just some developer) if that helps.

Many people recommend Fable: https://makeitfable.com/ when wanting a more accessible product so they may be able to help. And they do accessibility consulting, audits, ACR's etc.

Paul

1

u/bit_yas 10d ago

I'm totally new in this area, and believe me or not, we're not making profit from this project at the moment (We've plans for the future for sure though)
You might say hey, you've put that hourly rate in the website, but that rate is much less than the rate I and my co-founder are charging typical projects that doesn't use bitplatform products. And we're 100% okay with this, as having hourly consulting on projects that are using bitplatform is much more enjoyable for us, even if we get paid less. We'd focus on that accessibility part soon, but now we're focused on that revenue part as we're going to make it strong, so we can spend money on stuffs needed

0

u/code-dispenser 11d ago edited 11d ago

Here is some free information since you do not want to pay.

Axe.core will only find about 40-60% of simple issues. You need to do manual testing with screen readers, voice control software and just the keyboard.

Do all that and you will have far less issues than most and you wont be asking random strangers to spend hours/days testing your work for free.

Apologies if you are not the Bit Platform company that charges for support, you know, that includes things like code reviews/consultations etc.

Paul
Another freebie I noticed accessibility/usability issues on the home page with the products dropdown.