This repository was archived by the owner on Jul 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +15
-1
lines changed Expand file tree Collapse file tree 5 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ className | String | Classes to be applied to the root element.
4646raised | Boolean | Enables raised variant.
4747unelevated | Boolean | Enables unelevated variant.
4848outlined | Boolean | Enables outlined variant.
49+ dense | Boolean | Enables dense variant.
4950icon | Element | Icon to render within root element.
5051children | String | Text to be displayed within root element.
5152disabled | Boolean | Disables button if true.
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export class Button extends Component {
3232 raised,
3333 unelevated,
3434 outlined,
35+ dense,
3536 icon,
3637 children,
3738 initRipple,
@@ -43,6 +44,7 @@ export class Button extends Component {
4344 'mdc-button--raised' : raised ,
4445 'mdc-button--unelevated' : unelevated ,
4546 'mdc-button--outlined' : outlined ,
47+ 'mdc-button--dense' : dense ,
4648 } ) ;
4749
4850 const SemanticButton = this . props . href ? 'a' : 'button' ;
@@ -76,6 +78,7 @@ Button.propTypes = {
7678 raised : PropTypes . bool ,
7779 unelevated : PropTypes . bool ,
7880 outlined : PropTypes . bool ,
81+ dense : PropTypes . bool ,
7982 disabled : PropTypes . bool ,
8083 unbounded : PropTypes . bool ,
8184 initRipple : PropTypes . func ,
@@ -89,6 +92,7 @@ Button.defaultProps = {
8992 raised : false ,
9093 unelevated : false ,
9194 outlined : false ,
95+ dense : false ,
9296 disabled : false ,
9397 unbounded : false ,
9498 initRipple : ( ) => { } ,
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ const ButtonScreenshotTest = () => {
3939 < Button disabled raised > Disabled Raised</ Button >
4040 </ div >
4141
42+ < div className = 'button-container' >
43+ < Button dense > Dense</ Button >
44+ </ div >
45+
4246 < div className = 'button-container' >
4347 < Button href = 'https://google.com' raised > Anchor Tag</ Button >
4448 </ div >
Original file line number Diff line number Diff line change 11{
2- "button" : " b01eeaad126491150baf47a736f5d5fbcfc284e62a47d91e9e50dcf1163925c1 " ,
2+ "button" : " a0cf6b2a5d09400657303bb2a7b220dbe33642a8f44fd7571cdfcf5517fb3586 " ,
33 "card" : " b2fd82763c383be438ff6578083bf9009711c7470333d07eb916ab690fc42d31" ,
44 "line-ripple" : " 56b136db2dc7e09260849447e6bde9b55a837af332a05d9f52506ab1c95e2e57" ,
55 "fab" : " db36f52195c420062d91dd5ebe5432ad87247b3c1146fd547b0a195079bbce2f" ,
Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ test('renders an outlined button', () => {
3838 assert . isTrue ( wrapper . hasClass ( 'mdc-button--outlined' ) ) ;
3939} ) ;
4040
41+ test ( 'renders a dense button' , ( ) => {
42+ const wrapper = shallow ( < Button dense /> ) ;
43+ assert . isTrue ( wrapper . hasClass ( 'mdc-button--dense' ) ) ;
44+ } ) ;
45+
4146test ( 'renders a button tag' , ( ) => {
4247 const wrapper = shallow ( < Button /> ) ;
4348 assert . equal ( wrapper . type ( ) , 'button' ) ;
You can’t perform that action at this time.
0 commit comments