Using User Input to filter Dataframe

I want to create a webapp that filters out the rows of a dataframe based on user input text.

Here is an example df.

|id|titles|price|
|0|None|Chemistry 13e Raymond Chang and Jason Overby M…|$5|
|1|None|Biology Laboratory Manual by Darrell S. Vodopi…|$60|
|2|None|Precalculus : 738 Fully Solved Problems by Fre…|$60|
|3|None|LIBRARY BOOK SALE - BAG DAY|$70|
|4|None|Fiction paperback Collection 4 Sale|$70|

if a user writes “Biology” using the following code:

import numpy as np
mask = np.column_stack([df1[col].str.contains("Biology", na=False) for col in df])
df1.loc[mask.any(axis=1)]

the webapp should output this:

|id|titles|price|
|1|None|Biology Laboratory Manual by Darrell S. Vodopi…|$60|

I’m having hard time figuring out how to make the datatable dynamic by using the appcallback to change the datatable.