Button Slide : show simple icon, on hover : show icon + text
<iframe src="https://stackblitz.com/edit/ad-button-slide?embed=1&file=src/app/app.component.html&hideExplorer=1&hideNavigation=1&view=preview" style="width:100%;height:330px;border:none;"></iframe>- Install the library :
npm i ad-button-slide
- Import the module :
import { AdButtonSlideModule } from 'ad-button-slide';
@NgModule({
imports: [ ..., AdButtonSlideModule ], ...
- (optional) import an icon library like fontawesome (
npm i @fortawesome/fontawesome-free
) - Play with the component :-)
<ad-button-slide icon="fas fa-trash" label="Delete this" background="red"></ad-button-slide>
ad-button-slide
- (AdButtonSlideComponent
) - button slide component object.
Parameters supported by this object:
icon
: string; - icon class, eg. 'fa fa-trash'label
: string; - label displayed on hoverbackground
: string = '#aaa'; - css background colorforeground
: string = 'white'; - css font colorbackgroundOver
: string = null; - css background color when mouseOver, if no value given : backgroundOver = backgroundforegroundOver
: string = null; - css font color when mouseOver, if no value given : foregroundOver = foregroundmini
: boolean = false; - boolean to make the button tiny
clone this project and run 'npm i && npm start'
MIT License
Adrien Dessilly