Comments (7)
Oh, another possible solution would be to have two Navbars and arrange them in a Grid. That's my preferred one, currently. What I am asking for, is probably not even part of the bootstrap standard.
from elm-bootstrap.
Running into this now as well. We're voracious & happy consumers of this great library (thanks @rundis!) Will try dropdown workaround
from elm-bootstrap.
Cheers. Didn't have time to look at this with my push for a 4.0.0 release.
You can do a crazy amount of stuff with nav and navbars in bootstrap. It's a bit hard to come up with an API that is easy to use and still super-flexible to handle use cases like this. I'll give it some though when I have some time, alternatively someone comes up with some design ideas that aids this and potentially other common exceptions to the stuff currently supported.
from elm-bootstrap.
Running into this as well!
from elm-bootstrap.
I would like to be able to specify whether my Navbar.items
are aligned left or right, but I guess that is sort of related?
from elm-bootstrap.
Hi! Thanks for this package. We are experimenting with converting Richard Feldman's implementation of the Real World SPA to use Elm Bootstrap. One immediate problem is the Navbar.
In the templates the navbar doesn't use collapse wrapper (it's basically non-responsive) and the stylesheet makes some assumptions about it. Simply replacing their navbar with one created using Bootstrap.Navbar
results in all items being always hidden. We tried to use the standard bootstrap stylesheet and then adjusting it. That's how we ran into this issue - it seems impossible to align items right without doing some hacks.
Since you have asked for design ideas, let me drop my two cents. IMO having two types (Navbar.Item
and Navbar.CustomItem
) where group of Item
is always on the left and CustomItem
always on the right is mixing concerns. Looking at the docs from Bootstrap website I see that they have different groups inside a navbar (specifically Brand, Nav, Form, Text) with different accepted children and default behavior. Each group can take bootstrap classes (like ml-auto
to push it to the right). Note that there are examples of navbar-text
without brand
and such, so the configuration of groups is pretty arbitrary.
Maybe we should try to encode it in the types? The Navbar would take a list of Group
where group could be a union type:
type Group
= Brand (List (Html.Attribute msg)) (List (Html msg))
| Nav (List (Html.Attribute msg)) (List NavItem)
| Form (List (Html.Attribute msg)) (List (Html msg))
| Text (List (Html.Attribute msg)) (List (Html msg))
While rendering, each group would have some default attributes (e.g. Nav
grows to take all the space) but attributes provided as first argument to the constructor would take precedence. Perhaps Form
and Text
could be merged into single Custom
constructor.
Benefits:
- Greater flexibility
- Decoupling of type from layout
- Semantic output (with ARIA attributes etc.)
Please let me know what you think. I can't promise but if we have time we will try to implement it in our app, see how it goes and if you like it prepare a PR.
Once again, thanks for your efforts here.
from elm-bootstrap.
any updates on this? I'd really like to align some items right
from elm-bootstrap.
Related Issues (20)
- Progress bar height attribute should be in the wrapper
- Vertical Buttongroups should use only class "btn-group-vertical"
- Website on v5.0.0 docs HOT 1
- Radio buttons using ... buttons?
- Form.Range is not exposed in elm.json file HOT 2
- Modal header "close" button should have `type="button"`
- Config Bootstrap.Navbar.collapseSmall
- Cannot use Flex HOT 1
- Modal Scrollable Body config does not actually work
- Error in documentation for Pagination
- attrs is not exposed by Alert
- Block.text in a single line
- No option to hide the NavBar Menu after Clicking a Menu item HOT 3
- Spinner.spinner does not work with bootstrap 4.0.0
- Support .form-row
- Expose a way to know which tab is active HOT 6
- Clicking on the navbar dropdown menu changes the current url
- How to create Navbar submenus? HOT 2
- Any plan to upgrade to Bootstrap 5 ?
- No backdrop on second modal
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-bootstrap.