The withdrawal of the United Kingdom from the European Union (Brexit) on 31 January  does not affect the requirements to travel toor from the United Kingdom. Travellers going from Spain to the United Kingdom or vice versa will be able to continue to travel with the ID card or valid passport until 31 December 2020.

If you are travelling with your pet, the pet must have a  microchip, valid vaccines and an European passport. Once the transition period has finished you must comply with the United Kingdom requirements.

During the transition period also  all the passenger rights will remain the same according to the  Community Regulation.

More information:

Spanish Government: travelling after Brexit

Ministry for Transport, Mobility and Urban Development: travelling to/from the United Kingdom

Ministry for  Agriculture, Fisheries and Food: pet entry requirements