code for adding cart widget to a page

I want to add a cart widget using code rather than drag and drop from admin. What's the code for that. specifically the shopping cart.

Thanks.