Comments (5)
This is pretty similar to what I had to implement within the app I'm working on.
Addition of Title API to styles would make it no-brainer. Title colors and horizontal alignment (left, center,right) would be a welcome addition too!
from lipgloss.
Thanks @eugener. Iām on holiday for the next few weeks and will look at it when Iām back. I do think this is a common enough request that we should accommodate it.
from lipgloss.
Implementation specifics aside, this seems like a good addition, though it may also be better off as a standalone component. If we were to add it to the library we'd also need to be able to set colors as well as the option to have both a top and bottom label simultaneously, and potential horizontal padding on the label.
If this is something you need right now here's a basic implementation you can start from: https://gist.github.com/meowgorithm/1777377a43373f563476a2bcb7d89306
from lipgloss.
@meowgorithm Please take a look at related PR #97. Hopefully, with few iterations, this API can become a part of the library
from lipgloss.
I would also like to add a title to my border, similar to TermUI:
https://raw.githubusercontent.com/gizak/termui/master/_assets/demo.gif
Thanks!
from lipgloss.
Related Issues (20)
- feat: flexbox HOT 6
- RTL languages messes the layout! HOT 2
- Span entire terminal width HOT 2
- feat: Better border joining
- No colors when running the example HOT 1
- is boder bug? HOT 2
- Ghost text being left behind when using `Height` HOT 1
- Example to toggle full screen? HOT 7
- random output of ANSI escape sequences with 0.7.1 HOT 11
- Setting `BorderTop(false)` disappears entire border HOT 3
- Unexpected artifacts from lg.JoinVertical
- Renderer-level style rules
- Middle string truncation
- Background style is not rendered when wrapping other rendered styles HOT 4
- TopRight and BottomRight border not showing when rendering an empty string and no left border HOT 1
- OSC 8 (hyperlink) supports. HOT 1
- String transform method
- style.go::Render at 'Render core text' is not ansi aware when using a spaced styler HOT 1
- Text alignment logic is backwards for non-special-cases
- Overlap views HOT 2
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 lipgloss.