Comments (9)
You can also use css only.
Here is my code
<div className='alerts-container'>
<AlertContainer ref={a => { this.msg = a; }} {...this.options} />
</div>
.alerts-container {
> div[class^='css-'] > span > div[class^='css-'] {
// entire alert styles here.
div {
// alert icon
&:first-child {
}
// alert message div
&:nth-child(2) {
}
// alert close div
&:last-child {
}
}
}
}
from react-alert.
with v3 you can now create custom alert templates, hope it helps!
from react-alert.
Hi @ok713, you can refer to #20:
You can use a React Element as a message, so to add a text-transform you could do something like this:
this.msg.success(<div style={{textTransform: 'capitalize'}}>TEXT WILL BE CAPITALIZED</div>)
Hope this helps!
from react-alert.
@ok713 did you solved your issue?
from react-alert.
It will be really handy if single alert container could have class depending on type. I'll ease stylying. Also each element (icon, content and close-btn) could have separated class.
from react-alert.
@davidhu2000 What kind of CSS syntax is this? VSCode is not accepting it
EDIT: And neither does CSSLint http://csslint.net/
from react-alert.
@neilyoung might be scss
from react-alert.
@davidhu2000 Thanks for enlighten me :)
EDIT: And it works
from react-alert.
Finally :) , but a little late. We had to migrate to another alerts package.
However this give us an oportunity to go back to use yours :)
from react-alert.
Related Issues (20)
- Missing Alert warning type support HOT 1
- Custom options in `alert.show()` HOT 4
- peerDependencies HOT 4
- Update the demo HOT 1
- TypeScript HOT 4
- change the black background HOT 1
- Close HOT 2
- Custom alert type with typescript HOT 1
- Add New Transitions like slide from left / right
- Many contexts in one component HOT 1
- Test cases getting failed on using useAlert() HOT 3
- Showing Below the Model HOT 1
- How do I trigger an alert as a function? HOT 1
- Show alert in react dom tree HOT 1
- TypeError: Cannot read properties of undefined (reading 'current') HOT 7
- Onclose callback doesnt run if I manually close the alert dialoge.
- Feature request
- how to change default black theme?
- No compatibility with new react 18 HOT 4
- error while installing without --legacy-peer-deps
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 react-alert.