ui icon indicating copy to clipboard operation
ui copied to clipboard

It would be great to set text on a button itself

Open Nogbit opened this issue 8 years ago • 6 comments

I know you've commented on #99 about the pita that text can be to a library like this, but, when making UI's it is often the case to have a button with text in the button itself or even an icon/font to save space in the UI because labels just take up too much room. Currently, I'll have to use bootstrap and this when making my UI.

It's possible I could help out with this if you like, let me know if that interests you. For the first stab I would probably limit the implementation to just the button and possibly have another button type other than round.

Nogbit avatar Oct 20 '17 01:10 Nogbit

Are you talking about something like the text button? It accepts only text, not icons, but sound similar to what you're imagining.

taylorbf avatar Oct 20 '17 02:10 taylorbf

Wow, not sure how I missed that, but yes, that's what I would like. If icon support was built in that would be great. Maybe something similar to how these handle icons. http://materializecss.com/buttons.html

Nogbit avatar Oct 21 '17 03:10 Nogbit

Poked around a bit at https://github.com/nexus-js/ui/blob/master/lib/interfaces/textbutton.js and it shouldn't be too difficult to implement an icon and alternate icon in the same way text is implemented. Any preferred icon libs, googles icon font? I don't see any contrib guidelines, I can set something up and do a pull request if you are interested.

Nogbit avatar Oct 21 '17 03:10 Nogbit

That would be a welcome contribution, thanks! There is 1 other PR that I should resolve first, in case there is any overlapping code. Will do that as soon as I can and let you know.

taylorbf avatar Oct 21 '17 13:10 taylorbf

Good to hear. Another thing I would like to add is non moveable points to Envelope. I'm building an ADSR editor and traditionally the first and last points are fixed bottom left and right respectively. I think there are a lot of different ways of approaching that one.

Nogbit avatar Oct 22 '17 03:10 Nogbit

for a super cheap text addition on a regular button: https://codepen.io/dirkk0/pen/XWoKLWa

dirkk0 avatar Sep 02 '23 10:09 dirkk0