-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom styling for labels for Tabs #2
Comments
This case is different from places where you are expecting label to a string or valid hiccup markup because in this you are expected to store that data inside an atom or a map. |
How about this compromise? Create a new parameter called That would allow you to supply a While we are at it, should we also create an |
Thats exactly what I had in mind. So the changes would be something like: (let [id-fn (or (:id-fn t)
(fn [x] (:id x)))
label-fn (or (:label-fn t)
(fn [x] (:label x)))
id (id-fn t)
label (label-fn t)]
.... |
The nice thing about "named parameters" is that you can provide defaults. So the default values for |
So this code: Would change to look like this (untested):
|
ah of course. I was obviously doing the wrong thing. Thanks! |
I got the propsed changes working in my branch. Further changes:
I haven't modified the other tab styles but they would also be impacted by 2). |
Thanks! We'll push a new version later today. |
Thats great. Thanks @mike-thompson-day8! |
- Issue #2 - Custom styling for labels for Tabs. - Also added the same support for the dropdown component. - Issue #4 - Split Component: Add on-drag-complete function to the API. - Also added class, style and attr parameters to both split components. - Pull request: Fixed usage example for scroller v-scroll variable. - Correct various working and spelling mistakes.
Works in v0.5.0. Thanks a lot! |
Hi,
Firstly a great library. Its really well done!
I am also building an atom-shell app using cljs, reagent and bootstrap. So this fits in really neatily into the stack.
I had a suggesting for enhancement, namely being able to apply a custom function to a label on a tab. I noticed that strictly speaking it doesn't need to be a string. The label just gets nested inside a
:a
tag.I suggest that instead of
:label
being a requirement for an element:tabs
, the user have an option to give alabel-fn
which when given anid
produces the correct markup.My use case is that I have dynamic tabs some of which can be closed. This can be done with the current API itself but not in a clean way.
Thanks!
P.S. I am happy to submit a PR.
The text was updated successfully, but these errors were encountered: