Material-table: Increase the SearchField width

Created on 3 Sep 2019  路  3Comments  路  Source: mbrn/material-table

How to increase or just set to given value the search field width?

This is not working:

components={{
    Toolbar: props => (
        <div style={{ searchField: { width: 600 }}}>
            <MTableToolbar {...props} />
        </div>
    )
}}

Most helpful comment

@kslysz This is undocumented anywhere, but it works ;)

          components={{
            Toolbar: props => (
                  <MTableToolbar {...props} searchFieldStyle={{width: 600}} />
              )
          }}

All 3 comments

@kslysz This is undocumented anywhere, but it works ;)

          components={{
            Toolbar: props => (
                  <MTableToolbar {...props} searchFieldStyle={{width: 600}} />
              )
          }}

Thanks @buszmen201. It works :)

This also works and is documented:

options= {{
    searchFieldStyle: {
        width: 600,
    }
}}

It's listed here (https://material-table.com/#/docs/all-props).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VipinJoshi picture VipinJoshi  路  3Comments

lazeebee picture lazeebee  路  3Comments

roseak picture roseak  路  3Comments

revskill10 picture revskill10  路  3Comments

bohrsty picture bohrsty  路  3Comments